couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Kocoloski <>
Subject the "_design/blah" URL encoding issue
Date Sat, 08 Nov 2008 19:22:07 GMT
Hi, CouchDB used to have some special-case code (added in r663055)  
that would allow the '/' in a design document URL to be supplied  
without encoding.  The associated JIRA issue is

Recent trunk builds still have that special case code, but it only  
takes effect if the HTTP verb is POST (see line 233 of  
couch_httpd_db.erl).  This actually breaks remote replication, since  
the _all_docs_by_seq view still reports design doc IDs as "_design/ 
blah", and couch_rep:open_doc_revs falls over when it tries to GET a  
document with that ID.

I'm happy to submit a patch to restore the old behavior.  Was there a  
reason for restricting the unencoded '/' code to POSTs?

By the way, using a '/' in the design doc ID suggests to me that  
_design/ is itself a valid resource.  Perhaps it would also make sense  
to add:

GET /dbname/_design/  -> retrieve a list of design documents
POST /dbname/_design/ -> create a new design doc with an auto- 
generated ID

GET /dbname/_view/blah/ -> retrieve a list of views defined in this  
design doc

What do others think?  Regards, Adam

View raw message