You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Sam Bisbee (Closed) (JIRA)" <ji...@apache.org> on 2012/02/22 06:04:49 UTC

[jira] [Closed] (COUCHDB-332) Reject documents whose ids start with underscore

     [ 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