tough-cookie
Advanced tools
Comparing version 2.5.0 to 3.0.0
@@ -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" |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
87070
1655
0
3
+ Addedip-regex@^3.0.0
+ Addedip-regex@3.0.0(transitive)