mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
dont encode hash part of url
This commit is contained in:
parent
5c4d013e16
commit
4791bf0ca8
1 changed files with 4 additions and 1 deletions
|
@ -46,11 +46,14 @@ export function rewriteUrl(url: string | URL, meta: URLMeta) {
|
||||||
if (base.startsWith("about:")) base = unrewriteUrl(self.location.href); // jank!!!!! weird jank!!!
|
if (base.startsWith("about:")) base = unrewriteUrl(self.location.href); // jank!!!!! weird jank!!!
|
||||||
const realUrl = tryCanParseURL(url, base);
|
const realUrl = tryCanParseURL(url, base);
|
||||||
if (!realUrl) return url;
|
if (!realUrl) return url;
|
||||||
|
const hash = realUrl.hash;
|
||||||
|
realUrl.hash = "";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
location.origin +
|
location.origin +
|
||||||
$scramjet.config.prefix +
|
$scramjet.config.prefix +
|
||||||
$scramjet.codec.encode(realUrl.href)
|
$scramjet.codec.encode(realUrl.href) +
|
||||||
|
hash
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue