piral-cli 0.15.0-alpha.3640 → 0.15.0-alpha.3662

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.
@@ -46011,8 +46011,9 @@ RedirectableRequest.prototype._processResponse = function (response) {
46011
46011
  var redirectUrlParts = url.parse(redirectUrl);
46012
46012
  Object.assign(this._options, redirectUrlParts);
46013
46013
 
46014
- // Drop the confidential headers when redirecting to another domain
46015
- if (!(redirectUrlParts.host === currentHost || isSubdomainOf(redirectUrlParts.host, currentHost))) {
46014
+ // Drop confidential headers when redirecting to another scheme:domain
46015
+ if (redirectUrlParts.protocol !== currentUrlParts.protocol ||
46016
+ !isSameOrSubdomain(redirectUrlParts.host, currentHost)) {
46016
46017
  removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
46017
46018
  }
46018
46019
 
@@ -46178,7 +46179,10 @@ function abortRequest(request) {
46178
46179
  request.abort();
46179
46180
  }
46180
46181
 
46181
- function isSubdomainOf(subdomain, domain) {
46182
+ function isSameOrSubdomain(subdomain, domain) {
46183
+ if (subdomain === domain) {
46184
+ return true;
46185
+ }
46182
46186
  const dot = subdomain.length - domain.length - 1;
46183
46187
  return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
46184
46188
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-cli",
3
- "version": "0.15.0-alpha.3640",
3
+ "version": "0.15.0-alpha.3662",
4
4
  "description": "The standard CLI for creating and building a Piral instance or a Pilet.",
5
5
  "keywords": [
6
6
  "portal",
@@ -77,5 +77,5 @@
77
77
  "typescript": "^4.0.2",
78
78
  "yargs": "^15.4.1"
79
79
  },
80
- "gitHead": "29ee91f865f9ee42229e58a7804cba6ab5e9145b"
80
+ "gitHead": "b7ec6c01e99557f270b2558a7cb23bec8e6ce0da"
81
81
  }