Fix the check (protocol includes colon)

This commit is contained in:
Manav Rathi
2024-06-12 16:50:45 +05:30
parent 523317eb71
commit 622c4e7258

View File

@@ -169,7 +169,8 @@ const Page = () => {
export default Page;
const isHTTP = (url: URL) => url.protocol == "http" || url.protocol == "https";
// Not 100% accurate, but good enough for our purposes.
const isHTTP = (url: URL) => url.protocol.startsWith("http");
const redirectToURL = (url: URL) => {
log.info(`Redirecting to ${url.href}`);