Skip to content

Commit c5c023e

Browse files
committedJun 7, 2017
[#18] Fix db.getUrl() is not a function
In PouchDB 6.x, the db.getUrl() method was deprecated. Instead use db.name to extract base URL. Fixes #18.
1 parent dedc8a2 commit c5c023e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ module.exports = function httpQuery(db, req) {
7272
}
7373

7474
//strips the database from the requested_path
75-
var url = db.getUrl().split("/").slice(0, -2).join("/") + req.raw_path;
75+
var url = db.name.replace(/\/[^\/]+\/?$/, "") + req.raw_path;
7676
var pouchHeaders = (db.getHeaders || fakeGetHeaders)();
7777
var headers = extend({}, pouchHeaders, req.headers);
7878

0 commit comments

Comments
 (0)
Please sign in to comment.