-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
express-pouchdb: removes "/" from db names #213
Comments
CouchDB allows
See also http://docs.couchdb.org/en/2.0.0/api/database/common.html#put--db
|
Instead of sanitizing a database name, we should throw an error for invalid database names. |
We use the current
I’m not sure how CouchDB behaves for the url rewiretes ( |
Good point @gr2m I agree. We should throw errors. I'm also not 100% about 3 but I would default to throwing an error as well if we are unsure. |
@garrensmith @nolanlawson @marten-de-vries I can just go ahead and fix it. Can you give me pointers regarding adding tests for it? |
Sure thing, you can add tests in pouchdb-server/tests/express-pouchdb/test.js Lines 231 to 249 in 55aa193
In general I am cool with just doing whatever CouchDB does. If it's a breaking change, then that's fine, we'll release 3.0.0. |
okay, I tested against my local CouchDB 1.6 to see what errors we should return. Sending any request (with any http verb) which includes an invalid databas name returns Current
I’m looking into this now |
there you go: #214 |
Currently
express-pouchdb
is removing/
from filenames before initializing db instances for the current request inpouchdb-server/packages/node_modules/express-pouchdb/lib/clean-filename.js
Line 9 in 55aa193
pouchdb-server/packages/node_modules/express-pouchdb/lib/utils.js
Line 67 in 55aa193
At Hoodie, we currently use
express-pouchdb
inside our server and we pass our PouchDB constructor. Our user databases have the formatuser/:uuid
. The problem now is that if I start listening to changes of dbuser/abc4567
in Hoodie, then no changes will ever happen becauseexpress-pouchdb
internally renames the database touserabc4567
The text was updated successfully, but these errors were encountered: