diff --git a/index.js b/index.js index f58b933..c649cab 100644 --- a/index.js +++ b/index.js @@ -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 diff --git a/test/test.js b/test/test.js index 97e9653..8413192 100644 --- a/test/test.js +++ b/test/test.js @@ -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 () {