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.
@@ -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 the confidential headers when redirecting to another domain
46420
- if (!(redirectUrlParts.host === currentHost || isSubdomainOf(redirectUrlParts.host, currentHost))) {
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 isSubdomainOf(subdomain, domain) {
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-cli",
3
- "version": "0.14.10-beta.3659",
3
+ "version": "0.14.10-beta.3661",
4
4
  "description": "The standard CLI for creating and building a Piral instance or a Pilet.",
5
5
  "keywords": [
6
6
  "portal",