From 1daf045506eeca949824bccd8aa79b98659651bf Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 17 Oct 2023 07:59:56 -0400 Subject: [PATCH] fix: debug --- src/backend/filters/urlRewrite.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/filters/urlRewrite.ts b/src/backend/filters/urlRewrite.ts index d29819b..2a9b225 100644 --- a/src/backend/filters/urlRewrite.ts +++ b/src/backend/filters/urlRewrite.ts @@ -18,7 +18,6 @@ export default class URLRewriteFilter implements ContentFilter { .each((index, element) => { let attrName = ["a", "link"].includes(tag) ? "href" : "src"; let urlValue = $(element).attr(attrName); - if (urlValue) { if (!isICANN(urlValue)) { if ( @@ -26,9 +25,11 @@ export default class URLRewriteFilter implements ContentFilter { urlValue.startsWith("../") || urlValue.startsWith("http") ) { + console.log("before", urlValue); if (!urlValue.startsWith("/")) { urlValue = `/${urlValue}`; } + console.log("after", urlValue); $(element).attr(attrName, `/browse${urlValue}`); } }