From 68b97a6753f322f6e8e95ffb9c92f36ef5c04ca9 Mon Sep 17 00:00:00 2001 From: Xi Gou Date: Sun, 16 Jun 2024 20:19:49 +0800 Subject: [PATCH] fix: don't allow invalid url like 'http:127.0.0.1' (#766) --- src/helpers/global.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/global.ts b/src/helpers/global.ts index b56c036..45c7b0c 100644 --- a/src/helpers/global.ts +++ b/src/helpers/global.ts @@ -3,7 +3,7 @@ export const isSingBox = (version: string) => { } export const transformEndpointURL = (url: string) => - /^https?/.test(url) ? url : `${window.location.protocol}//${url}` + /^https?:\/\//.test(url) ? url : `${window.location.protocol}//${url}` export const useStringBooleanMap = () => { const [map, setMap] = createSignal>({})