@percy/core 1.32.9-beta.0 → 1.32.9

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.
Files changed (2) hide show
  1. package/dist/network.js +23 -3
  2. package/package.json +10 -10
package/dist/network.js CHANGED
@@ -731,9 +731,29 @@ export function logAssetInstrumentation(log, category, reason, details) {
731
731
  });
732
732
  }
733
733
 
734
- // Returns the normalized origin URL of a request
735
- function originURL(request) {
736
- return normalizeURL((request.redirectChain[0] || request).url);
734
+ // True when `from` is `to` with an https:// scheme — the abandoned leg of
735
+ // Chrome's HTTPS-upgrade fallback.
736
+ function isHttpsUpgradeFallback(from, to) {
737
+ return from.startsWith('https://') && to.startsWith('http://') && from.slice('https:'.length) === to.slice('http:'.length);
738
+ }
739
+
740
+ // Returns the URL the document referenced — the head of the redirect chain for
741
+ // a real server redirect. Chrome surfaces its HTTPS-upgrade fallback as a
742
+ // redirect hop, so an http:// URL arrives with the abandoned https:// attempt
743
+ // at the head. Keying a resource under that URL hides the snapshot's own root
744
+ // resource and leaks the fetched page to later snapshots through the URL-keyed
745
+ // discovery cache, so skip those hops. A genuine same-path https->http server
746
+ // redirect is indistinguishable from the fallback and is skipped too; that is
747
+ // rare enough (misconfigured proxies) to be the better trade.
748
+ export function originURL(request) {
749
+ let chain = request.redirectChain;
750
+ for (let i = 0; i < chain.length; i++) {
751
+ var _chain;
752
+ let url = normalizeURL(chain[i].url);
753
+ let next = normalizeURL(((_chain = chain[i + 1]) === null || _chain === void 0 ? void 0 : _chain.url) ?? request.url);
754
+ if (!isHttpsUpgradeFallback(url, next)) return url;
755
+ }
756
+ return normalizeURL(request.url);
737
757
  }
738
758
 
739
759
  // Convert Fetch event responseHeaders ([{name, value}, …]) to a header object.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.32.9-beta.0",
3
+ "version": "1.32.9",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public",
12
- "tag": "beta"
12
+ "tag": "latest"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">=14"
@@ -46,12 +46,12 @@
46
46
  "dependencies": {
47
47
  "@grpc/grpc-js": "^1.14.3",
48
48
  "@grpc/proto-loader": "^0.8.0",
49
- "@percy/client": "1.32.9-beta.0",
50
- "@percy/config": "1.32.9-beta.0",
51
- "@percy/dom": "1.32.9-beta.0",
52
- "@percy/logger": "1.32.9-beta.0",
53
- "@percy/monitoring": "1.32.9-beta.0",
54
- "@percy/webdriver-utils": "1.32.9-beta.0",
49
+ "@percy/client": "1.32.9",
50
+ "@percy/config": "1.32.9",
51
+ "@percy/dom": "1.32.9",
52
+ "@percy/logger": "1.32.9",
53
+ "@percy/monitoring": "1.32.9",
54
+ "@percy/webdriver-utils": "1.32.9",
55
55
  "adm-zip": "^0.6.0",
56
56
  "busboy": "^1.6.0",
57
57
  "content-disposition": "^0.5.4",
@@ -67,7 +67,7 @@
67
67
  "yaml": "^2.4.1"
68
68
  },
69
69
  "optionalDependencies": {
70
- "@percy/cli-doctor": "1.32.9-beta.0"
70
+ "@percy/cli-doctor": "1.32.9"
71
71
  },
72
- "gitHead": "b80116ed1841a2548d2c59cab8d69f5a4d9bd74f"
72
+ "gitHead": "598d96e0ae2f4fde8cdcd9e1542eff3f8bd7e8ab"
73
73
  }