couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Kocoloski (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COUCHDB-521) negotiate_content_type does not detect application/json in HTTP Accept header if it includes a qvakue
Date Thu, 08 Oct 2009 14:04:31 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763499#action_12763499
] 

Adam Kocoloski commented on COUCHDB-521:
----------------------------------------

Should we be ignoring the q value?  What if a user sends

Accept: application/json; q=0, text/plain

Admittedly, we need to do something to fix the current behavior.

> 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.


Mime
View raw message