This commit is contained in:
github-actions[bot]
2026-04-15 12:20:46 +00:00
parent 6847a42aa8
commit 9df9e9176e
11 changed files with 176 additions and 11 deletions
+16 -1
View File
@@ -100163,6 +100163,11 @@ var require_follow_redirects = __commonJS({
} catch (error3) {
useNativeURL = error3.code === "ERR_INVALID_URL";
}
var sensitiveHeaders = [
"Authorization",
"Proxy-Authorization",
"Cookie"
];
var preservedUrlFields = [
"auth",
"host",
@@ -100227,6 +100232,7 @@ var require_follow_redirects = __commonJS({
self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
}
};
this._headerFilter = new RegExp("^(?:" + sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") + ")$", "i");
this._performRequest();
}
RedirectableRequest.prototype = Object.create(Writable.prototype);
@@ -100364,6 +100370,9 @@ var require_follow_redirects = __commonJS({
if (!options.headers) {
options.headers = {};
}
if (!isArray(options.sensitiveHeaders)) {
options.sensitiveHeaders = [];
}
if (options.host) {
if (!options.hostname) {
options.hostname = options.host;
@@ -100469,7 +100478,7 @@ var require_follow_redirects = __commonJS({
this._isRedirect = true;
spreadUrlObject(redirectUrl, this._options);
if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
removeMatchingHeaders(this._headerFilter, this._options.headers);
}
if (isFunction(beforeRedirect)) {
var responseDetails = {
@@ -100618,6 +100627,9 @@ var require_follow_redirects = __commonJS({
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isArray(value) {
return value instanceof Array;
}
function isString2(value) {
return typeof value === "string" || value instanceof String;
}
@@ -100630,6 +100642,9 @@ var require_follow_redirects = __commonJS({
function isURL(value) {
return URL2 && value instanceof URL2;
}
function escapeRegex(regex) {
return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
}
module2.exports = wrap({ http, https: https2 });
module2.exports.wrap = wrap;
}