diff --git a/src/lib/links.ts b/src/lib/links.ts index 269e84de..c89c4104 100644 --- a/src/lib/links.ts +++ b/src/lib/links.ts @@ -20,31 +20,6 @@ const ALLOWED_ORIGINS = [ "rolt.chat", ]; -/** - * Permissible protocols in URLs - */ -const PROTOCOL_WHITELIST = [ - "http:", - "https:", - "ftp:", - "ftps:", - "mailto:", - "news:", - "irc:", - "gopher:", - "nntp:", - "feed:", - "telnet:", - "mms:", - "rtsp:", - "svn:", - "git:", - "tel:", - "fax:", - "xmpp:", - "magnet:", -]; - /** * Determine what kind of link we are dealing with and sanitise any malicious input * @param href Input URL @@ -65,9 +40,7 @@ export function determineLink(href?: string): LinkType { } catch (err) {} if (!internal && url) { - if (PROTOCOL_WHITELIST.includes(url.protocol)) { - return { type: "external", href, url }; - } + return { type: "external", href, url }; } }