fetch-cookie
Advanced tools
Comparing version 0.5.0 to 0.6.0
11
index.js
@@ -21,4 +21,13 @@ var denodeify = require('es6-denodeify')(Promise) | ||
.then(function (res) { | ||
var cookies = res.headers.getAll('set-cookie') | ||
var cookies | ||
if (res.headers.getAll) { | ||
// node-fetch v1 | ||
cookies = res.headers.getAll('set-cookie') | ||
} else { | ||
// node-fetch v2 | ||
var cookie = res.headers.get('set-cookie') | ||
cookies = cookie && cookie.split(',') || [] | ||
} | ||
if (!cookies.length) { | ||
@@ -25,0 +34,0 @@ return res |
{ | ||
"name": "fetch-cookie", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Decorator for a `fetch` function to support automatic cookies.", | ||
@@ -23,3 +23,5 @@ "homepage": "https://github.com/valeriangalliat/fetch-cookie", | ||
"scripts": { | ||
"test": "standard" | ||
"lint": "standard", | ||
"prepublish": "npm run lint && npm test", | ||
"test": "mocha" | ||
}, | ||
@@ -31,4 +33,7 @@ "dependencies": { | ||
"devDependencies": { | ||
"express": "^4.14.1", | ||
"mocha": "^3.2.0", | ||
"node-fetch": "^1.6.3", | ||
"standard": "^4.0.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6218
60
4