fetch-cookie
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -19,13 +19,13 @@ var assign = Object.assign || require('object-assign') | ||
return fetch(url, assign(opts, { | ||
headers: assign(opts.headers || {}, { cookie: cookie }), | ||
headers: assign(opts.headers || {}, { cookie: cookie }) | ||
})) | ||
}) | ||
.then(function (res) { | ||
var cookie = res.headers.get('set-cookie') | ||
var cookies = res.headers.getAll('set-cookie') | ||
if (!cookie) { | ||
if (!cookies.length) { | ||
return res | ||
} | ||
return setCookie(cookie, url) | ||
return Promise.all(cookies.map(cookie => setCookie(cookie, url))) | ||
.then(function () { | ||
@@ -32,0 +32,0 @@ return res |
{ | ||
"name": "fetch-cookie", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Decorator for a `fetch` function to support automatic cookies.", | ||
@@ -21,2 +21,5 @@ "homepage": "https://github.com/valeriangalliat/fetch-cookie", | ||
}, | ||
"scripts": { | ||
"test": "standard" | ||
}, | ||
"dependencies": { | ||
@@ -27,3 +30,6 @@ "es6-denodeify": "^0.1.1", | ||
"tough-cookie": "^1.1.0" | ||
}, | ||
"devDependencies": { | ||
"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
4038
1