fix: improve rewrites
This commit is contained in:
parent
03595ac3de
commit
238195ad98
|
@ -21,10 +21,12 @@ export default class URLRewriteFilter implements ContentFilter {
|
|||
|
||||
if (urlValue) {
|
||||
if (!isICANN(urlValue)) {
|
||||
if (urlValue.startsWith("/")) {
|
||||
if (
|
||||
urlValue.startsWith("/") ||
|
||||
urlValue.startsWith("../") ||
|
||||
urlValue.startsWith("http")
|
||||
) {
|
||||
$(element).attr(attrName, `/browse${urlValue}`);
|
||||
} else if (urlValue.startsWith("http")) {
|
||||
$(element).attr(attrName, `/browse/${urlValue}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue