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

When a query parameter has the same value as that in the request body on POST method - the value of that parameter is missing later

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • 4.0.0.CR1
    • 2.3.2.Final, 3.0.5.Final
    • jaxrs
    • None

    Description

      When a query parameter has the same value as that in the request body on POST method - the value of that parameter is missing later

      Here is an example:

      @Path("/my_path")
      @Produces(MediaType.TEXT_HTML)
      public interface MyService {
      
          @GET
          Response readAction(@QueryParam("action") String action);
      
      
          @POST
          Response postReadAction(@FormParam("action") String action)
      }
      
      $ curl -d "action=test" "http://myserver/my_path"
      action: test
      
      e.g. the action parameter in the body is read and this is the expected
      answer.
      
      
      $ curl -d "action=test1" "http://myserver/my_path?action=test"
      action: test1
      
      
      This is also OK, the verb is POST and the action value is test1 (as it is
      in the body).
      
      
      $ curl -d "action=test" "http://myserver/my_path?action=test"
      action:
      In this case (action parameter appears as form and query parameter and has
      the same value) the action parameter value is missing.
      

      *********
      The problem is in org.jboss.resteasy.plugins.server.servlet.HttpServletInputMessage#getDecodedFormParameters() - there is an explicit check whether the same parameter and value is passed as query param, if yes - the value is ignored.

      if (!queryValues.contains(val))
      {
         decodedFormParameters.add(name, val);
      }
      

      I think that issue is similar(if not the same) to this one: https://issues.jboss.org/browse/RESTEASY-760.

      Attachments

        Issue Links

          Activity

            People

              rsigal@redhat.com Ronald Sigal
              rossitsa.borissova Rossitsa Borissova (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: