From dev-return-17087-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Thu Jul 7 19:28:40 2011 Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 506EF41D1 for ; Thu, 7 Jul 2011 19:28:40 +0000 (UTC) Received: (qmail 23081 invoked by uid 500); 7 Jul 2011 19:28:39 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 22955 invoked by uid 500); 7 Jul 2011 19:28:38 -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 22937 invoked by uid 99); 7 Jul 2011 19:28:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jul 2011 19:28:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jul 2011 19:28:37 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E2F544BC07 for ; Thu, 7 Jul 2011 19:28:16 +0000 (UTC) Date: Thu, 7 Jul 2011 19:28:16 +0000 (UTC) From: "Robert Newson (JIRA)" To: dev@couchdb.apache.org Message-ID: <2001081270.8737.1310066896926.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1743068035.35683.1306146887384.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (COUCHDB-1175) Improve content type negotiation for couchdb JSON responses MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-1175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13061517#comment-13061517 ] Robert Newson commented on COUCHDB-1175: ---------------------------------------- http://www.gethifi.com/blog/browser-rest-http-accept-headers IE sends: Accept: image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/msword, */* Both text/html and application/json have the same preference value (1.0). Whichever way we jump, something goes wrong. The point of insisting on 'Accept: application/json' exactly is that only explicit calls from code, XHR, etc, can do it, it's unlike anything any browser sends. I don't much *like* the solution, but I don't see a better one right now. > Improve content type negotiation for couchdb JSON responses > ----------------------------------------------------------- > > Key: COUCHDB-1175 > URL: https://issues.apache.org/jira/browse/COUCHDB-1175 > Project: CouchDB > Issue Type: Improvement > Affects Versions: 1.0.2 > Reporter: Robert Newson > Assignee: Robert Newson > Priority: Blocker > Fix For: 1.1.1, 1.2 > > > Currently we ignore qvalues when negotiation between 'application/json' and 'text/plain' when returning JSON responses. > Specifically, we test directly for 'application/json' or 'text/plain' in the Accept header. Different branches have different bugs, though. Trunk returns 'application/json' if 'application/json' is present at all, even if it's less preferred than 'text/plain' when qvalues are accounted for. > We should follow the standard. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira