Commit 1804f73
fix(service-worker): preserve referrer in asset requests
Preserve referrer metadata when the service worker reconstructs asset requests for cache-busted and redirected asset fetches.
For example, an attacker with access to asset host logs could receive a reset token embedded in a page URL if the reconstructed request falls back to default referrer behavior instead of carrying referrer: ''.
(cherry picked from commit 99ad47e)1 parent 91df739 commit 1804f73Copy full SHA for 1804f73
3 files changed
+46-5Lines changed: 46 additions & 5 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- packages/service-worker/worker
- src
- testing
- test
Expand file treeCollapse file tree
Open diff view settings
Collapse file
packages/service-worker/worker/src/assets.ts
Copy file name to clipboardExpand all lines: packages/service-worker/worker/src/assets.ts+5-4Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
501 | 501 | |
502 | 502 | |
503 | 503 | |
504 | | - |
505 | | - |
506 | | - |
507 | | - |
| 504 | + |
| 505 | + |
| 506 | + |
| 507 | + |
508 | 508 | |
509 | 509 | |
510 | 510 | |
| ||
532 | 532 | |
533 | 533 | |
534 | 534 | |
| 535 | + |
535 | 536 | |
536 | 537 | |
537 | 538 | |
|
Collapse file
packages/service-worker/worker/test/happy_spec.ts
Copy file name to clipboardExpand all lines: packages/service-worker/worker/test/happy_spec.ts+36Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1672 | 1672 | |
1673 | 1673 | |
1674 | 1674 | |
| 1675 | + |
| 1676 | + |
| 1677 | + |
| 1678 | + |
| 1679 | + |
| 1680 | + |
| 1681 | + |
| 1682 | + |
| 1683 | + |
| 1684 | + |
| 1685 | + |
| 1686 | + |
| 1687 | + |
| 1688 | + |
| 1689 | + |
| 1690 | + |
1675 | 1691 | |
1676 | 1692 | |
1677 | 1693 | |
| ||
1765 | 1781 | |
1766 | 1782 | |
1767 | 1783 | |
| 1784 | + |
| 1785 | + |
| 1786 | + |
| 1787 | + |
| 1788 | + |
| 1789 | + |
| 1790 | + |
| 1791 | + |
| 1792 | + |
| 1793 | + |
| 1794 | + |
| 1795 | + |
| 1796 | + |
| 1797 | + |
| 1798 | + |
| 1799 | + |
| 1800 | + |
| 1801 | + |
| 1802 | + |
| 1803 | + |
1768 | 1804 | |
1769 | 1805 | |
1770 | 1806 | |
|
Collapse file
packages/service-worker/worker/testing/fetch.ts
Copy file name to clipboardExpand all lines: packages/service-worker/worker/testing/fetch.ts+5-1Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
130 | 130 | |
131 | 131 | |
132 | 132 | |
133 | | - |
| 133 | + |
134 | 134 | |
135 | 135 | |
136 | 136 | |
| ||
163 | 163 | |
164 | 164 | |
165 | 165 | |
| 166 | + |
| 167 | + |
| 168 | + |
166 | 169 | |
167 | 170 | |
168 | 171 | |
| ||
179 | 182 | |
180 | 183 | |
181 | 184 | |
| 185 | + |
182 | 186 | |
183 | 187 | |
184 | 188 | |
|
0 commit comments