From dev-return-11705-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Mon Sep 13 17:54:57 2010 Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 91091 invoked from network); 13 Sep 2010 17:54:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Sep 2010 17:54:57 -0000 Received: (qmail 29922 invoked by uid 500); 13 Sep 2010 17:54:56 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 29798 invoked by uid 500); 13 Sep 2010 17:54: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 29789 invoked by uid 99); 13 Sep 2010 17:54:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 17:54: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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 17:54:55 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8DHsYeX001570 for ; Mon, 13 Sep 2010 17:54:35 GMT Message-ID: <10015773.156931284400474755.JavaMail.jira@thor> Date: Mon, 13 Sep 2010 13:54:34 -0400 (EDT) From: "Jason Smith (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Updated: (COUCHDB-882) Nonstandard HTTP methods not converted to JSON correctly In-Reply-To: <22144580.69141283916633721.JavaMail.jira@thor> 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-882?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason Smith updated COUCHDB-882: -------------------------------- Attachment: 0001-For-unknown-HTTP-methods-Use-a-binary-for-httpd.meth.patch Simplified patch which simply converts any non-atom received from mochi into binary. > Nonstandard HTTP methods not converted to JSON correctly > -------------------------------------------------------- > > Key: COUCHDB-882 > URL: https://issues.apache.org/jira/browse/COUCHDB-882 > Project: CouchDB > Issue Type: Bug > Components: HTTP Interface > Affects Versions: 1.0.1 > Environment: Erlang R13, Linux > Reporter: Jason Smith > Priority: Minor > Fix For: 1.0.1 > > Attachments: 0001-For-unknown-HTTP-methods-Use-a-binary-for-httpd.meth.patch, 0001-For-unknown-HTTP-methods-Use-a-binary-for-httpd.meth.patch > > > Since COUCHDB-815, CouchDB allows nonstandard or unknown HTTP methods in case a _show or similar function may want to implement a response to that method. > Unfortunately the (my) patch in that ticket used couch_util:to_existing_atom which returns the passed value unmodified if it has no corresponding atom. That is wrong because the HTTP method will be copied into the `req` object in the view server, therefore it must not be an Erlang string (list of integers) because those do not JSONify correctly. Instead, if the atom does not exist, the method should be converted to a binary. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.