Browse Source

feat: default to wss:// when URL has no protocol

imwald
codytseng 1 year ago
parent
commit
be7081359d
  1. 1
      src/providers/RelaySettingsProvider.tsx

1
src/providers/RelaySettingsProvider.tsx

@ -47,6 +47,7 @@ export function RelaySettingsProvider({ children }: { children: React.ReactNode @@ -47,6 +47,7 @@ export function RelaySettingsProvider({ children }: { children: React.ReactNode
const searchParams = new URLSearchParams(window.location.search)
const tempRelays = searchParams
.getAll('r')
.map((url) => (url.startsWith('wss://') || url.startsWith('ws://') ? url : `wss://${url}`))
.filter((url) => isWebsocketUrl(url))
.map((url) => normalizeUrl(url))
if (tempRelays.length) {

Loading…
Cancel
Save