Fix Content-Type responses that include Accept header flags
The Content-Type header may include the quality flags or other user-flags.
Below is an example where the Accept quality flag is copied into the response.
$ curl -v -H 'Accept: text/plain;q=0.5,application/json;q=0.1' 'http://localhost:8080/' ...
< HTTP/1.1 200 OK
< Date: Tue, 02 Sep 2014 00:22:14 GMT
< Content-Type: text/plain;q=0.5
< Transfer-Encoding: chunked
* Server Jetty(9.2.2.v20140723) is not blacklisted
< Server: Jetty(9.2.2.v20140723)
This change updates the Media Type negotiation logic to instead use the produced content-type if compatible, rather than copying the candidate accept header in some cases.
You can merge this pull request into a Git repository by running:
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1
Author: Eric Dahl <[hidden email]>
Update Accept header content negotiation to not echo back the user's
accept entry (including the quality flag) but instead use the actual
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket