You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Brian Candler (JIRA)" <ji...@apache.org> on 2009/04/24 10:42:30 UTC
[jira] Created: (COUCHDB-332) Reject documents whose ids start with
underscore
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
Priority: Minor
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.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (COUCHDB-332) Reject documents whose ids start
with underscore
Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Joseph Davis resolved COUCHDB-332.
---------------------------------------
Resolution: Fixed
Fix Version/s: 0.10
Assignee: Paul Joseph Davis
Fixed in trunk as of 769127.
> 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.
-
You can reply to this email to add a comment to the issue online.