We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f5029a commit 8b347cbCopy full SHA for 8b347cb
index.js
@@ -392,9 +392,9 @@ RedirectableRequest.prototype._processResponse = function (response) {
392
var redirectUrlParts = url.parse(redirectUrl);
393
Object.assign(this._options, redirectUrlParts);
394
395
- // Drop the Authorization header if redirecting to another domain
+ // Drop the confidential headers when redirecting to another domain
396
if (!(redirectUrlParts.host === currentHost || isSubdomainOf(redirectUrlParts.host, currentHost))) {
397
- removeMatchingHeaders(/^authorization$/i, this._options.headers);
+ removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
398
}
399
400
// Evaluate the beforeRedirect callback
0 commit comments