fix: debug

This commit is contained in:
Derrick Hammer 2023-10-17 07:59:56 -04:00
parent 9338ee8832
commit 1daf045506
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,6 @@ export default class URLRewriteFilter implements ContentFilter {
.each((index, element) => { .each((index, element) => {
let attrName = ["a", "link"].includes(tag) ? "href" : "src"; let attrName = ["a", "link"].includes(tag) ? "href" : "src";
let urlValue = $(element).attr(attrName); let urlValue = $(element).attr(attrName);
if (urlValue) { if (urlValue) {
if (!isICANN(urlValue)) { if (!isICANN(urlValue)) {
if ( if (
@ -26,9 +25,11 @@ export default class URLRewriteFilter implements ContentFilter {
urlValue.startsWith("../") || urlValue.startsWith("../") ||
urlValue.startsWith("http") urlValue.startsWith("http")
) { ) {
console.log("before", urlValue);
if (!urlValue.startsWith("/")) { if (!urlValue.startsWith("/")) {
urlValue = `/${urlValue}`; urlValue = `/${urlValue}`;
} }
console.log("after", urlValue);
$(element).attr(attrName, `/browse${urlValue}`); $(element).attr(attrName, `/browse${urlValue}`);
} }
} }