From dev-return-3986-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Tue Apr 21 16:41:17 2009 Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 7002 invoked from network); 21 Apr 2009 16:41:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Apr 2009 16:41:17 -0000 Received: (qmail 32795 invoked by uid 500); 21 Apr 2009 16:41:16 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 32719 invoked by uid 500); 21 Apr 2009 16:41:16 -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 32709 invoked by uid 99); 21 Apr 2009 16:41:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2009 16:41:16 +0000 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,NORMAL_HTTP_TO_IP,WEIRD_PORT 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; Tue, 21 Apr 2009 16:41:09 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 88D36234C003 for ; Tue, 21 Apr 2009 09:40:47 -0700 (PDT) Message-ID: <2058274304.1240332047544.JavaMail.jira@brutus> Date: Tue, 21 Apr 2009 09:40:47 -0700 (PDT) From: "Paul Joseph Davis (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Resolved: (COUCHDB-306) Wacky error responses to malformed documents In-Reply-To: <528122444.1237907756869.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-306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul Joseph Davis resolved COUCHDB-306. --------------------------------------- Resolution: Fixed This is fixed in trunk and 0.9.x now. > Wacky error responses to malformed documents > -------------------------------------------- > > Key: COUCHDB-306 > URL: https://issues.apache.org/jira/browse/COUCHDB-306 > Project: CouchDB > Issue Type: Improvement > Affects Versions: 0.9 > Reporter: Brian Candler > Assignee: Paul Joseph Davis > Priority: Minor > Fix For: 0.9.1, 0.10 > > > Here are some error conditions where CouchDB provides very strange responses. > ---- Setup ---- > $ curl -X PUT http://127.0.0.1:5984/foo > {"ok":true} > ---- example 1 ---- > $ curl -d "[]" -X PUT http://127.0.0.1:5984/foo/bar > {"error":"bad_request","reason":[68,111,99,117,109,101,110,116,32,109,117,115,116,32,98,101,32,97,32,74,83,79,78,32,111,98,106,101,99,116]} > ---- example 2 ---- > $ curl -d "[]" -X PUT http://127.0.0.1:5984/foo/_bulk_docs > -- TCP connection is dropped on the floor, no response (not even HTTP 500 status) > ---- example 3 ---- > $ curl -d "{}" -X POST http://127.0.0.1:5984/foo/bar > {"error":"badmatch","reason":"{\"application/x-www-form-urlencoded\",[]}"} > $ curl -d "{}" -H "Content-Type: application/json" -X POST http://127.0.0.1:5984/foo/bar > {"error":"badmatch","reason":"{\"application/json\",[]}"} > ---- example 4 ---- > $ curl -d '[]' -X POST http://127.0.0.1:5984/foo/_all_docs > {"error":"badmatch","reason":""} > ---- example 5 ---- > $ curl -d '{"keys":"foo"}' -X POST http://127.0.0.1:5984/foo/_all_docs > {"error":"unknown_error","reason":"function_clause"} > Of course, all of these are misuse of the API, but they may be seen by newcomers. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.