Skip to content

Commit

Permalink
fix: don't allow invalid url like 'http:127.0.0.1' (#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
XiGou authored Jun 16, 2024
1 parent 705893f commit 68b97a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Record<string, boolean>>({})
Expand Down

0 comments on commit 68b97a6

Please sign in to comment.