Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2831

NullPointerException in BaseHttpRequest if http Form POST does not specify Content-Type

XMLWordPrintable

    • Hide

       Create a simple JAX-RS resource endpoint with a @FormParam parameter and do an http POST without Content-Type header.

      @POST
      @Consumes(Constants.FORM_URLENCODED_UTF_8)
      @Produces(MediaType.TEXT_PLAIN)
      public String handleTokenRequest(@FormParam("my_param") String myParam) {
         return myParam;
      }
      Show
       Create a simple JAX-RS resource endpoint with a @FormParam parameter and do an http POST without Content-Type header. @POST @Consumes(Constants.FORM_URLENCODED_UTF_8) @Produces(MediaType.TEXT_PLAIN) public String handleTokenRequest(@FormParam( "my_param" ) String myParam) { return myParam; }
    • Low
    • Undefined

      An http form post without a "Content-Type" header causes a NullPointerException in org.jboss.resteasy.plugins.server.BaseHttpRequest.getFormParameters.

      While it is probably okay to throw an exception, it is very hard to figure out the reason for a NullPointerException deep in the implementation. 

              jperkins-rhn James Perkins
              renegrob76 René Grob (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: