Skip to content

Commit cd93bc9

Browse files
Add cookie support for node
... for better compatibility with the browser version
1 parent 621308b commit cd93bc9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var normalizeHeaderCase = require("header-case-normalizer");
2424
var extend = require("extend");
2525

2626
if (typeof global.XMLHttpRequest === "undefined") {
27-
global.XMLHttpRequest = require("xhr2"); //coverage: ignore
27+
global.XMLHttpRequest = require("xmlhttprequest-cookie").XMLHttpRequest;
2828
}
2929

3030
module.exports = function httpQuery(db, req) {

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pouchdb-req-http-query",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"main": "index.js",
55
"description": "Given a CouchDB request object, make a similar http request on a given PouchDB database.",
66
"repository": "pouchdb/pouchdb-req-http-query",
@@ -15,13 +15,13 @@
1515
"license": "Apache-2.0",
1616
"author": "Marten de Vries",
1717
"dependencies": {
18-
"xhr2": ">=0.0.7",
18+
"xmlhttprequest-cookie": "^0.9.2",
1919
"extend": "^1.3.0",
2020
"pouchdb-promise": "^0.0.0",
2121
"pouchdb-plugin-error": "^1.0.0",
2222
"header-case-normalizer": "^1.0.0"
2323
},
2424
"browser": {
25-
"xhr2": false
25+
"xmlhttprequest-cookie": false
2626
}
2727
}

0 commit comments

Comments
 (0)