mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 12:20:04 +02:00
update modules
This commit is contained in:
16
node_modules/tough-cookie/lib/cookie.js
generated
vendored
16
node_modules/tough-cookie/lib/cookie.js
generated
vendored
@@ -29,9 +29,9 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
'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');
|
||||
var Store = require('./store').Store;
|
||||
var MemoryCookieStore = require('./memstore').MemoryCookieStore;
|
||||
@@ -320,7 +320,7 @@ function domainMatch(str, domStr, canonicalize) {
|
||||
/* "All of the following [three] conditions hold:" (order adjusted from the RFC) */
|
||||
|
||||
/* "* The string is a host name (i.e., not an IP address)." */
|
||||
if (net.isIP(str)) {
|
||||
if (ipRegex.test(str)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1007,11 +1007,17 @@ CookieJar.prototype.setCookie = function(cookie, url, options, cb) {
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user