Skip to content

Commit

Permalink
Drop Proxy-Authorization across hosts.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenVerborgh committed Mar 14, 2024
1 parent 8526b4a commit c4f847f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -461,7 +461,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
1 change: 1 addition & 0 deletions test/test.js
Expand Up @@ -1529,6 +1529,7 @@ describe("follow-redirects", function () {

[
"Authorization",
"Proxy-Authorization",
"Cookie",
].forEach(function (header) {
describe("when the client passes an header named " + header, function () {
Expand Down

0 comments on commit c4f847f

Please sign in to comment.