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

Remove q-qs parameters from header Content-type in responses

XMLWordPrintable

    • 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

      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

              rsigal@redhat.com Ronald Sigal
              rhn-engineering-lgao Lin Gao
              Votes:
              0 Vote for this issue
              Watchers:
              3 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