New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

http-cookie-manager

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-cookie-manager - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

16

lib/cookie-parser.js

@@ -57,6 +57,16 @@ /**

{
if (!request || !request.headers || !request.method)
throw new TypeError(errors.requestMustBeIncomingMessage())
if (!request)
request = {
headers: {
cookie: ''
}
}
else if(!request.headers)
request.headers = {
cookie: ''
}
else if (!request.headers.cookie)
request.headers.cookie = ''
let cookieString = request.headers.cookie || ''
let cookieString = request.headers.cookie

@@ -63,0 +73,0 @@ return parseFrom(cookieString)

5

lib/errors.js

@@ -64,7 +64,2 @@ 'use strict'

requestMustBeIncomingMessage ()
{
return 'Request must be instance of IncomingMessage.'
},
invalidCookieString ()

@@ -71,0 +66,0 @@ {

{
"name": "http-cookie-manager",
"version": "1.0.0",
"version": "1.0.1",
"description": "Highly tested. Parses cookies, then stores them. Provides formatting for response header.",

@@ -5,0 +5,0 @@ "main": "lib/cookie-parser.js",

@@ -36,7 +36,21 @@

it('should throw an error if request is not an instance of IncomingMessage', function () {
it('should default request if not defined', function () {
expect(() => {
parser.parseWith(null)
}).to.throw(errors.requestMustBeIncomingMessage())
}).to.not.throw()
})
it('should default headers if not defined', function () {
expect(() => {
parser.parseWith({})
}).to.not.throw()
})
it('should default cookie string if not defined', function () {
expect(() => {
parser.parseWith({
headers: {}
})
}).to.not.throw()
})
})

@@ -43,0 +57,0 @@

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