Socket
Socket
Sign inDemoInstall

fetch-cookie

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-cookie - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

8

index.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc