Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8140,7 +8140,16 @@ RedirectableRequest.prototype._sanitizeOptions = function (options) {
if (!options.headers) {
options.headers = {};
}
if (!isArray(options.sensitiveHeaders)) {
// Convert [header1, value1, header2, value2, …] to object
else if (Array.isArray(options.headers)) {
var headerList = options.headers;
options.headers = {};
for (var i = 0; i < headerList.length; i += 2) {
options.headers[headerList[i]] = headerList[i + 1];
}
}
// Ensure sensitive headers are always present
if (!Array.isArray(options.sensitiveHeaders)) {
options.sensitiveHeaders = [];
}

Expand Down Expand Up @@ -8518,10 +8527,6 @@ function isSubdomain(subdomain, domain) {
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}

function isArray(value) {
return value instanceof Array;
}

function isString(value) {
return typeof value === "string" || value instanceof String;
}
Expand All @@ -8539,7 +8544,7 @@ function isURL(value) {
}

function escapeRegex(regex) {
return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
return regex.replace(/[[\]\\/()*+?.^$|]/g, "\\$&");
}

// Exports
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading