Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Fix Content-Type responses that include Accept header flags #1

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

ericdahl
Copy link

@ericdahl ericdahl commented Sep 2, 2014

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.

accept entry (including the quality flag) but instead use the actual
content-type.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant