negotiate_content_type does not detect application/json in HTTP Accept header
if it includes a qvakue
-----------------------------------------------------------------------------------------------------
Key: COUCHDB-521
URL: https://issues.apache.org/jira/browse/COUCHDB-521
Project: CouchDB
Issue Type: Bug
Components: HTTP Interface
Reporter: Ben Hollis
Priority: Minor
If I request a document from CouchDB with an Accept header like this:
Accept: application/json
Accept:
text/html,application/xhtml+xml,application/json,application/xml;q=0.9,*/*;q=0.8
CouchDB will serve back the response with the "application/json" content type.
However, if my Accept header looks like:
Accept:
text/html,application/xhtml+xml,application/json;q=0.9,application/xml;q=0.9,*/*;q=0.8
CouchDB responds with text/plain.
This seems to be because in src/couchdb/couch_httpd.erl, in
negotiate_content_type, the Accept header is split on "," and then searched for
"application/json". It should really discard anything after ";" when searching.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.