ziuyung/couchbrowse

Breaks w/ CouchDB test suite due to lack of URL encoding of database name

Opened this issue · 1 comments

1. Install CouchDB and run test suite. Test suite creates a database with a
forward slash (/) in the name, test_suite_db/with_slashes.
2. Build and run the couchbrowse project.
3. The app will not show the test_suite_db/with_slashes database or any
subsequently created database because it receives a 404 response in
CountDocuments.

It seems to be a URL encoding issue. The / in the database name needs to be
encoded, it should try to access
http://127.0.0.1:5984/test_suite_db%2Fwith_slashes.

I added a call to HttpUtility.UrlEncode in the CountDocuments method, but
in the DoRequest method when it creates the URL that encoding seems to
disappear.

Original issue reported on code.google.com by block...@gmail.com on 26 Feb 2009 at 8:57

I found the same issue. That's also commented in this thread (look to "Creating 
views
using PUT ")

http://mail-archives.apache.org/mod_mbox/couchdb-user/200811.mbox/thread

There they say "The .Net Uri object (and therefore the HttpWebRequest object) 
automatically unescapes the URI.  There doesn't appear to be any way to change 
this
behavior."

I have found that the problem doesn't happen in mono. 




Original comment by danical...@gmail.com on 5 May 2009 at 4:02