fix: rewrite fix

This commit is contained in:
Derrick Hammer 2023-10-17 11:01:22 -04:00
parent 2ae958fac7
commit a1e6ded70a
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ export default class URLRewriteFilter implements ContentFilter {
let attrName = ["a", "link"].includes(tag) ? "href" : "src";
let urlValue = $(element).attr(attrName);
if (urlValue) {
if (urlValue.startsWith("http") && !isICANN(urlValue)) {
if (!urlValue.startsWith("http") || !isICANN(urlValue)) {
$(element).attr(attrName, `/browse${urlValue}`);
}
}