make scramitize checks as strict as wrapfn

This commit is contained in:
Percs 2025-01-07 13:36:01 -06:00
parent 4b955d3dcb
commit 2978b4a12e
6 changed files with 244 additions and 233 deletions

View file

@ -27,9 +27,7 @@ export function unrewriteBlob(url: string) {
}
export function rewriteUrl(url: string | URL, meta: URLMeta) {
if (url instanceof URL) {
url = url.toString();
}
if (url instanceof URL) url = url.toString();
if (url.startsWith("javascript:")) {
return (
@ -58,9 +56,7 @@ export function rewriteUrl(url: string | URL, meta: URLMeta) {
}
export function unrewriteUrl(url: string | URL) {
if (url instanceof URL) {
url = url.toString();
}
if (url instanceof URL) url = url.toString();
const prefixed = location.origin + $scramjet.config.prefix;