Socket
Socket
Sign inDemoInstall

tough-cookie

Package Overview
Dependencies
3
Maintainers
3
Versions
45
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.5.0 to 3.0.0

16

lib/cookie.js

@@ -32,5 +32,5 @@ /*!

'use strict';
var net = require('net');
var urlParse = require('url').parse;
var util = require('util');
var ipRegex = require('ip-regex')({ exact: true });
var pubsuffix = require('./pubsuffix-psl');

@@ -324,3 +324,3 @@ var Store = require('./store').Store;

/* "* The string is a host name (i.e., not an IP address)." */
if (net.isIP(str)) {
if (ipRegex.test(str)) {
return false;

@@ -1012,7 +1012,13 @@ }

// S5.3 step 1
if (!(cookie instanceof Cookie)) {
if (typeof(cookie) === 'string' || cookie instanceof String) {
cookie = Cookie.parse(cookie, { loose: loose });
if (!cookie) {
err = new Error("Cookie failed to parse");
return cb(options.ignoreError ? null : err);
}
}
if (!cookie) {
err = new Error("Cookie failed to parse");
else if (!(cookie instanceof Cookie)) {
// If you're seeing this error, and are passing in a Cookie object,
// it *might* be a Cookie object from another loaded version of tough-cookie.
err = new Error("First argument to setCookie must be a Cookie object or string");
return cb(options.ignoreError ? null : err);

@@ -1019,0 +1025,0 @@ }

// generated by genversion
module.exports = '2.5.0'
module.exports = '3.0.0'

@@ -46,3 +46,3 @@ {

],
"version": "2.5.0",
"version": "3.0.0",
"homepage": "https://github.com/salesforce/tough-cookie",

@@ -66,3 +66,3 @@ "repository": {

"engines": {
"node": ">=0.8"
"node": ">=6"
},

@@ -77,2 +77,3 @@ "devDependencies": {

"dependencies": {
"ip-regex": "^3.0.0",
"psl": "^1.1.28",

@@ -79,0 +80,0 @@ "punycode": "^2.1.1"

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc