apache / nano

Nano is now part of Apache CouchDB. Repo moved to https://GitHub.com/apache/couchdb-nano
https://github.com/apache/couchdb-nano
Other
1.13k stars 157 forks source link

Handle database names with `/` in them #291

Closed BigBlueHat closed 7 years ago

BigBlueHat commented 9 years ago

reported earlier: https://github.com/jo/couchdb-push/issues/13

Right now, if I give couchdb-push (which depends on nano) a URL like http://localhost:5984/mail/bigbluehat-com/byoung it throws the following error:

...\node_modules\couchdb-push\node_modules\couchdb-ensure\index.js:12
  couch.request({
        ^
TypeError: undefined is not a function

If I escape them, however, things work as they should: http://localhost:5984/mail%2Fbigbluehat-com%2Fbyoung

Obviously the escaped version is what CouchDB actually wants, but it'd be nice for the developer to not have to care that much--or go figure out what's needed from that error.

Having this as part of the library would save a bunch of URL parsing boilerplate in other people's code too, fwiw.

Thanks!

carlosduclos commented 7 years ago

This repository has been merged into apache/couchdb-nano, please continue the discussion here.

BigBlueHat commented 7 years ago

👍