File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2121 </ head >
2222 < body >
2323 < main > Session expired.</ main >
24- < script >
25- // The client-side code for this is: `src/assets/js/reload.js`, and it's
26- // only ever called in `src/assets/js/fetcher.js`.
27- const reload = new URL (
28- new URLSearchParams ( window . location . search ) . get ( 'reload' ) || '/' ,
29- // If no origin is specified, then use ours.
30- // e.g. "/foobar.html" ->"https://${document.location.origin}/foobar.html"
31- // Our client code always specifies an origin, so the extra validation
32- // below is for non-dino-park users of this file.
33- window . location . origin
34- ) ;
35- // Only redirect internally. External redirects are handled by the
36- // backend. `reload` uses the current origin when constructing it's
37- // redirect URL, and so we redo that here to hedge against untrustworthy
38- // input.
39- const reloadUrl = new URL ( reload . pathname , window . location . origin ) ;
40- // Preserve the rest of the URL.
41- reloadUrl . search = reload . search ;
42- reloadUrl . hash = reload . hash ;
43- // Punt to the backend, it'll deal with the 404, etc, etc.
44- window . location . href = reloadUrl . toString ( ) ;
45- </ script >
4624 </ body >
25+ < script src ="reload.js "> </ script >
4726</ html >
Original file line number Diff line number Diff line change 1+ // The client-side code for this is: `src/assets/js/reload.js`, and it's
2+ // only ever called in `src/assets/js/fetcher.js`.
3+ const reload = new URL (
4+ new URLSearchParams ( window . location . search ) . get ( 'reload' ) || '/' ,
5+ // If no origin is specified, then use ours.
6+ // e.g. "/foobar.html" ->"https://${document.location.origin}/foobar.html"
7+ // Our client code always specifies an origin, so the extra validation
8+ // below is for non-dino-park users of this file.
9+ window . location . origin
10+ ) ;
11+ // Only redirect internally. External redirects are handled by the
12+ // backend. `reload` uses the current origin when constructing its
13+ // redirect URL, and so we redo that here to hedge against untrustworthy
14+ // input.
15+ const reloadUrl = new URL ( reload . pathname , window . location . origin ) ;
16+ // Preserve the rest of the URL.
17+ reloadUrl . search = reload . search ;
18+ reloadUrl . hash = reload . hash ;
19+ // Punt to the backend, it'll deal with the 404, etc, etc.
20+ window . location . href = reloadUrl . toString ( ) ;
You can’t perform that action at this time.
0 commit comments