piral-cli 0.14.10-beta.3659 → 0.14.10-beta.3661
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/external/index.js +7 -3
- package/package.json +1 -1
package/lib/external/index.js
CHANGED
|
@@ -46416,8 +46416,9 @@ RedirectableRequest.prototype._processResponse = function (response) {
|
|
|
46416
46416
|
var redirectUrlParts = url.parse(redirectUrl);
|
|
46417
46417
|
Object.assign(this._options, redirectUrlParts);
|
|
46418
46418
|
|
|
46419
|
-
// Drop
|
|
46420
|
-
if (
|
|
46419
|
+
// Drop confidential headers when redirecting to another scheme:domain
|
|
46420
|
+
if (redirectUrlParts.protocol !== currentUrlParts.protocol ||
|
|
46421
|
+
!isSameOrSubdomain(redirectUrlParts.host, currentHost)) {
|
|
46421
46422
|
removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
|
|
46422
46423
|
}
|
|
46423
46424
|
|
|
@@ -46583,7 +46584,10 @@ function abortRequest(request) {
|
|
|
46583
46584
|
request.abort();
|
|
46584
46585
|
}
|
|
46585
46586
|
|
|
46586
|
-
function
|
|
46587
|
+
function isSameOrSubdomain(subdomain, domain) {
|
|
46588
|
+
if (subdomain === domain) {
|
|
46589
|
+
return true;
|
|
46590
|
+
}
|
|
46587
46591
|
const dot = subdomain.length - domain.length - 1;
|
|
46588
46592
|
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
|
|
46589
46593
|
}
|