Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-13928

[GSS](7.1.z) RESTEASY-1765 - Remove q-qs parameters from header Content-type in responses

XMLWordPrintable

    • Workaround Exists
    • Hide

      Annotate the method with a specific content type for Produces that does not contain q-qs.

      Show
      Annotate the method with a specific content type for Produces that does not contain q-qs.
    • Hide

      Reproduce this behavior should be simply: send a request with two content type, give a quality factor to some of mime type and it will be returned. This happens in some specific scenario:

      • It only happens when you don't have a MediaType declared in the resource method;

      So, giving the following JAX-RS method:

      @Path("resource")
      public class Resource {
      
      	@GET
      	@Path("other")
      	public Response other() {
      		return Response.ok("other invoked").build();
      	}
      
      }
      

      You can simply reproduce it:

      $ curl -H 'Accept: application/json;q=0.3, application/xml;q=0.2' -D - http://localhost:8080/01840977-reproducer/resource/other
      HTTP/1.1 200 OK
      Connection: keep-alive
      X-Powered-By: Undertow/1
      Server: JBoss-EAP/7
      Content-Type: application/json;q=0.3
      Content-Length: 13
      Date: Mon, 20 Nov 2017 02:22:31 GMT
      
      Show
      Reproduce this behavior should be simply: send a request with two content type, give a quality factor to some of mime type and it will be returned. This happens in some specific scenario: It only happens when you don't have a MediaType declared in the resource method; So, giving the following JAX-RS method: @Path( "resource" ) public class Resource { @GET @Path( "other" ) public Response other() { return Response.ok( "other invoked" ).build(); } } You can simply reproduce it: $ curl -H 'Accept: application/json;q=0.3, application/xml;q=0.2' -D - http: //localhost:8080/01840977-reproducer/resource/other HTTP/1.1 200 OK Connection: keep-alive X-Powered-By: Undertow/1 Server: JBoss-EAP/7 Content-Type: application/json;q=0.3 Content-Length: 13 Date: Mon, 20 Nov 2017 02:22:31 GMT
    • EAP 7.1.1

      In some cases the quality factors are returned in Content-type header. Usually this won't affect clients, but the quality factors should be only used for the Accept header as described in HTML specification: https://tools.ietf.org/html/rfc7231#section-5.3.2

              rhn-engineering-lgao Lin Gao
              rhn-support-wsiqueir William Siqueira
              Peter Mackay Peter Mackay
              Peter Mackay Peter Mackay
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 2 days
                  2d
                  Remaining:
                  Remaining Estimate - 2 days
                  2d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified