-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace request.origin/path/query with request.url (#3126)
* replace request.origin/path/query with request.url * fix some stuff * typo * lint * fix test * fix xss vuln * fix test * gah * fixes * simplify * use pathname+search as key * all tests passing * lint * tidy up * update types in docs * update docs * more docs * more docs * more docs * i would be lost without conduitry * update template app * throw useful error when trying to access path/query/origin/page * $params -> $route.params, only use getters in dev, remove the word "deprecate" * update docs * finish updating load input section * update * make this section less verbose * move url into $route * update some docs * rename route store back to page * throw errors on accessing $page.path etc * fix types * fix some docs * fix migrating docs * decode path, strip prefix * tidy up * remove comment * lint * Update documentation/docs/05-modules.md Co-authored-by: Ben McCann <[email protected]> * Update documentation/migrating/04-pages.md Co-authored-by: Ben McCann <[email protected]> Co-authored-by: Ben McCann <[email protected]>
- Loading branch information
1 parent
d138efe
commit d17f459
Showing
74 changed files
with
464 additions
and
473 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
<script context="module"> | ||
export function load({ page }) { | ||
let host = page.host; | ||
const i = host.indexOf(':'); | ||
if (i >= 0) { | ||
host = host.substring(0, i); | ||
} | ||
/** @type {import('@sveltejs/kit').Load} */ | ||
export function load({ url }) { | ||
return { | ||
redirect: '/top/1', | ||
status: host === 'localhost' || host === '127.0.0.1' ? 302 : 301 | ||
status: url.hostname === 'localhost' || url.hostname === '127.0.0.1' ? 302 : 301 | ||
}; | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.