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 563529631 for ; Wed, 22 Feb 2012 05:05:18 +0000 (UTC) Received: (qmail 47253 invoked by uid 500); 22 Feb 2012 05:05:17 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 47026 invoked by uid 500); 22 Feb 2012 05:05: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 47005 invoked by uid 99); 22 Feb 2012 05:05:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2012 05:05:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,NORMAL_HTTP_TO_IP,T_RP_MATCHES_RCVD,WEIRD_PORT 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; Wed, 22 Feb 2012 05:05:10 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 864F83331F1 for ; Wed, 22 Feb 2012 05:04:49 +0000 (UTC) Date: Wed, 22 Feb 2012 05:04:49 +0000 (UTC) From: "Sam Bisbee (Closed) (JIRA)" To: dev@couchdb.apache.org Message-ID: <27121631.2805.1329887089551.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Closed] (COUCHDB-332) Reject documents whose ids start with underscore 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-332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sam Bisbee closed COUCHDB-332. ------------------------------ Resolved for a while. Closing. > Reject documents whose ids start with underscore > ------------------------------------------------ > > Key: COUCHDB-332 > URL: https://issues.apache.org/jira/browse/COUCHDB-332 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface > Environment: 0.10.0a767851 > Reporter: Brian Candler > Assignee: Paul Joseph Davis > Priority: Minor > Fix For: 0.10 > > > docids which start with underscore are reserved for CouchDB. I believe they should be rejected to avoid confusion. > Currently observed behaviour: > (1) an attempt to PUT to /db/_docid succeeds, and creates a document whose ID starts with an underscore > $ curl -X PUT -d "{}" http://127.0.0.1:5984/foo/_xxx > {"ok":true,"id":"_xxx","rev":"1-1751372641"} > (2) a POST to /db/_docid tries to do something and fails; possibly it could succeed given the right headers and body. > $ curl -X POST -d "{}" http://127.0.0.1:5984/foo/_yyy > {"error":"bad_content_type","reason":"Invalid Content-Type header for form upload"} > -- status line show 415 Unsupported Media Type > This means that typos can result in confusing error messages; for example, a POST to /db/_tmp_view instead of /db/_temp_view. IMO it would be cleaner first to test the docid and reject it on that basis. > (Sorry, I am not including a test suite submission. It will be much easier for someone who already knows their way around the rather large set of private libraries which the test suite contains. I currently use Ruby to talk to CouchDB, not ECMAscript) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira