Commit df19bfe
committed
fix(site): parse the bounce
Build the restored URL by feeding `p` into the URL constructor and
appending any extra search params from the bounce URL. The old version
concatenated strings, which produced a malformed `/foo?a=1?x=2` if `p`
already carried a query (or an extra param landed on the bounce URL).
Also reject `p` values that don't look like same-origin relative paths
so a crafted `?p=//host/foo` can't try to flip the visible origin.
Addresses Copilot feedback on #15.?p= value through URL before restoring1 parent c3a0da1 commit df19bfe
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
23 | 35 | | |
24 | 36 | | |
25 | 37 | | |
| |||
0 commit comments