🔧 npm update
This commit is contained in:
30
node_modules/follow-redirects/index.js
generated
vendored
30
node_modules/follow-redirects/index.js
generated
vendored
@@ -6,10 +6,21 @@ var Writable = require("stream").Writable;
|
||||
var assert = require("assert");
|
||||
var debug = require("./debug");
|
||||
|
||||
// Preventive platform detection
|
||||
// istanbul ignore next
|
||||
(function detectUnsupportedEnvironment() {
|
||||
var looksLikeNode = typeof process !== "undefined";
|
||||
var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
||||
var looksLikeV8 = isFunction(Error.captureStackTrace);
|
||||
if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
|
||||
console.warn("The follow-redirects package should be excluded from browser builds.");
|
||||
}
|
||||
}());
|
||||
|
||||
// Whether to use the native URL object or the legacy url module
|
||||
var useNativeURL = false;
|
||||
try {
|
||||
assert(new URL());
|
||||
assert(new URL(""));
|
||||
}
|
||||
catch (error) {
|
||||
useNativeURL = error.code === "ERR_INVALID_URL";
|
||||
@@ -346,17 +357,17 @@ RedirectableRequest.prototype._performRequest = function () {
|
||||
var buffers = this._requestBodyBuffers;
|
||||
(function writeNext(error) {
|
||||
// Only write if this request has not been redirected yet
|
||||
/* istanbul ignore else */
|
||||
// istanbul ignore else
|
||||
if (request === self._currentRequest) {
|
||||
// Report any write errors
|
||||
/* istanbul ignore if */
|
||||
// istanbul ignore if
|
||||
if (error) {
|
||||
self.emit("error", error);
|
||||
}
|
||||
// Write the next buffer if there are still left
|
||||
else if (i < buffers.length) {
|
||||
var buffer = buffers[i++];
|
||||
/* istanbul ignore else */
|
||||
// istanbul ignore else
|
||||
if (!request.finished) {
|
||||
request.write(buffer.data, buffer.encoding, writeNext);
|
||||
}
|
||||
@@ -461,7 +472,7 @@ RedirectableRequest.prototype._processResponse = function (response) {
|
||||
redirectUrl.protocol !== "https:" ||
|
||||
redirectUrl.host !== currentHost &&
|
||||
!isSubdomain(redirectUrl.host, currentHost)) {
|
||||
removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
|
||||
removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
|
||||
}
|
||||
|
||||
// Evaluate the beforeRedirect callback
|
||||
@@ -552,7 +563,7 @@ function noop() { /* empty */ }
|
||||
|
||||
function parseUrl(input) {
|
||||
var parsed;
|
||||
/* istanbul ignore else */
|
||||
// istanbul ignore else
|
||||
if (useNativeURL) {
|
||||
parsed = new URL(input);
|
||||
}
|
||||
@@ -567,7 +578,7 @@ function parseUrl(input) {
|
||||
}
|
||||
|
||||
function resolveUrl(relative, base) {
|
||||
/* istanbul ignore next */
|
||||
// istanbul ignore next
|
||||
return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
|
||||
}
|
||||
|
||||
@@ -616,7 +627,10 @@ function removeMatchingHeaders(regex, headers) {
|
||||
function createErrorType(code, message, baseClass) {
|
||||
// Create constructor
|
||||
function CustomError(properties) {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
// istanbul ignore else
|
||||
if (isFunction(Error.captureStackTrace)) {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
}
|
||||
Object.assign(this, properties || {});
|
||||
this.code = code;
|
||||
this.message = this.cause ? message + ": " + this.cause.message : message;
|
||||
|
||||
4
node_modules/follow-redirects/package.json
generated
vendored
4
node_modules/follow-redirects/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "follow-redirects",
|
||||
"version": "1.15.5",
|
||||
"version": "1.15.9",
|
||||
"description": "HTTP and HTTPS modules that follow redirects.",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
@@ -16,7 +16,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:follow-redirects/follow-redirects.git"
|
||||
"url": "git+ssh://git@github.com/follow-redirects/follow-redirects.git"
|
||||
},
|
||||
"homepage": "https://github.com/follow-redirects/follow-redirects",
|
||||
"bugs": {
|
||||
|
||||
Reference in New Issue
Block a user