lanto03 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

Can't access resources with slashes in their names #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Trying to access a document with a name like books/1 causes a GET request
like this:  GET /library/books/1 HTTP/1.1 . This is an error, because
documents can't have slashes in their names. On the other hand, if you try
to access books%2F1, the result requested resource is /library/books%252F1
, which isn't much better.

I changed the signature of the uri function to accept a flag that specifies
whether or not it should quote slashes and created two new wrapper
functions, id_uri (specifies that slashes must be quoted) and view_uri
(specifies that slashes mustn't be quoted.)

I'm attaching a patch against revision 44.

Original issue reported on code.google.com by juri.pak...@gmail.com on 17 Nov 2007 at 3:23

Attachments:

GoogleCodeExporter commented 8 years ago
The problem is that quoting the slashes breaks the view code, so attempting to 
access
views simply raises ResourceNotFound's.

Original comment by noah%tye...@gtempaccount.com on 24 Nov 2007 at 6:39

GoogleCodeExporter commented 8 years ago
As far as I can tell this has been fixed a while ago. It works for me with 
trunk (and I think also with the 0.4 
release).

Original comment by cmlenz on 16 Sep 2008 at 9:46