Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 32214 invoked from network); 8 Oct 2009 14:04:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Oct 2009 14:04:55 -0000 Received: (qmail 57855 invoked by uid 500); 8 Oct 2009 14:04:55 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 57779 invoked by uid 500); 8 Oct 2009 14:04:55 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 57769 invoked by uid 99); 8 Oct 2009 14:04:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Oct 2009 14:04:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Oct 2009 14:04:52 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 501B1234C052 for ; Thu, 8 Oct 2009 07:04:31 -0700 (PDT) Message-ID: <1358715147.1255010671310.JavaMail.jira@brutus> Date: Thu, 8 Oct 2009 07:04:31 -0700 (PDT) From: "Adam Kocoloski (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-521) negotiate_content_type does not detect application/json in HTTP Accept header if it includes a qvakue In-Reply-To: <473185159.1254976411274.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ 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.