Skip to content
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### dependabot: \#13 Bump follow-redirects from 1.15.4 to 1.15.9

### dependabot: \#12 Bump braces from 3.0.2 to 3.0.3

### dependabot: \#7 Bump follow-redirects from 1.15.2 to 1.15.4
Expand Down
31 changes: 23 additions & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11475,10 +11475,21 @@ var Writable = (__nccwpck_require__(2781).Writable);
var assert = __nccwpck_require__(9491);
var debug = __nccwpck_require__(1133);

// 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";
Expand All @@ -11496,6 +11507,7 @@ var preservedUrlFields = [
"protocol",
"query",
"search",
"hash",
];

// Create handlers that pass events from native requests
Expand Down Expand Up @@ -11814,17 +11826,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);
}
Expand Down Expand Up @@ -11929,7 +11941,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
Expand Down Expand Up @@ -12020,7 +12032,7 @@ function noop() { /* empty */ }

function parseUrl(input) {
var parsed;
/* istanbul ignore else */
// istanbul ignore else
if (useNativeURL) {
parsed = new URL(input);
}
Expand All @@ -12035,7 +12047,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));
}

Expand Down Expand Up @@ -12084,7 +12096,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;
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1651,9 +1651,9 @@ flatted@^3.1.0:
integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==

follow-redirects@^1.14.9:
version "1.15.4"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.4.tgz#cdc7d308bf6493126b17ea2191ea0ccf3e535adf"
integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==
version "1.15.9"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1"
integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==

for-each@^0.3.3:
version "0.3.3"
Expand Down