Skip to content
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

fix(urls): enable databases that are not hosted on domain root #216

Merged
merged 1 commit into from
Feb 3, 2018

Conversation

ptitjes
Copy link
Collaborator

@ptitjes ptitjes commented Jan 30, 2018

Databases can be proxied (nginx, express-pouch, ...) and be hosted
in a sub-path of a domain. This was not taken in account during
the refactoring to use url-parse (commit 7472135).

Fixes #215

Databases can be proxied (nginx, express-pouch, ...) and be hosted
in a sub-path of a domain. This was not taken in account during
the refactoring to use url-parse (commit 7472135).

Fixes pouchdb-community#215
@aanders77
Copy link

I recently started using PouchDB and this plugin. However I had to edit the sourcecode to make it work with my project. I host my remote db at https://www.[hidden].no/couchdb and I initiate it like this:
remotedb: new PouchDB("https://www.[hidden].no/couchdb/", { skip_setup: true, }),

When calling getSession(), I expect the URL to be www.[hidden].no/couchdb/_session..... but it gets rewritten to www.[hidden].no/_session..... (without the subdirectory). The code responsible for the rewrite is here https://github.com/pouchdb-community/pouchdb-authentication/blob/master/src/utils.js#L19-L24
Specifically line 22. This can't be the expected behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Login no longer works for non root databases
2 participants