fix: handle protocolless urls
This commit is contained in:
parent
02c2a59938
commit
cf826dce82
|
@ -38,6 +38,9 @@ export default class URLRewriteFilter implements ContentFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isICANN(url: string) {
|
function isICANN(url: string) {
|
||||||
|
if (url.startsWith("//")) {
|
||||||
|
url = `https:${url}`;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const parsedUrl = new URL(url);
|
const parsedUrl = new URL(url);
|
||||||
const domain = parsedUrl.hostname;
|
const domain = parsedUrl.hostname;
|
||||||
|
|
Loading…
Reference in New Issue