mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 07:20:02 -04:00
fix: stop logging encoded urls in css rewriter
This commit is contained in:
parent
85aa136fe0
commit
1b509b2c8a
1 changed files with 6 additions and 3 deletions
|
@ -16,8 +16,9 @@ function handleCss(type: "rewrite" | "unrewrite", css: string, meta?: URLMeta) {
|
||||||
css = new String(css).toString();
|
css = new String(css).toString();
|
||||||
css = css.replace(urlRegex, (match, url) => {
|
css = css.replace(urlRegex, (match, url) => {
|
||||||
const encodedUrl =
|
const encodedUrl =
|
||||||
type === "rewrite" ? rewriteUrl(url, meta) : unrewriteUrl(url);
|
type === "rewrite"
|
||||||
console.log(encodedUrl);
|
? rewriteUrl(url.trim(), meta)
|
||||||
|
: unrewriteUrl(url.trim());
|
||||||
|
|
||||||
return match.replace(url, encodedUrl);
|
return match.replace(url, encodedUrl);
|
||||||
});
|
});
|
||||||
|
@ -31,7 +32,9 @@ function handleCss(type: "rewrite" | "unrewrite", css: string, meta?: URLMeta) {
|
||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
const encodedUrl =
|
const encodedUrl =
|
||||||
type === "rewrite" ? rewriteUrl(url, meta) : unrewriteUrl(url);
|
type === "rewrite"
|
||||||
|
? rewriteUrl(url.trim(), meta)
|
||||||
|
: unrewriteUrl(url.trim());
|
||||||
|
|
||||||
return `${firstQuote}${encodedUrl}${endQuote}`;
|
return `${firstQuote}${encodedUrl}${endQuote}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue