Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7607

JAXRS only consider the first "Accept" header in the request

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.2, 3.1.15
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      For example, If we have method like

              @GET
      	@Path("/configuration")
      	@Produces(MediaType.APPLICATION_OCTET_STREAM)
      

      and request message header like

      Accept-Encoding: gzip,deflate
      Accept: application/vnd.vwg.mbb.vtsError_v1_0_0+xml
      Accept: application/octet-stream
      

      We will run into "HTTP 406 Not Acceptable "

      However the request should be valid as the second "Accept" is
      Accept: application/octet-stream
      which match the
      @Produces(MediaType.APPLICATION_OCTET_STREAM)
      so the request is acceptable.

      I checked the the W3C spec here[1], multiple "Accept" headers is allowed and should be given same significance as if all the entries has been in one field.

      [1]https://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z3

        Attachments

          Activity

            People

            • Assignee:
              ffang Freeman Fang
              Reporter:
              ffang Freeman Fang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: