feat: default to wss:// when URL has no protocol
This commit is contained in:
@@ -47,6 +47,7 @@ export function RelaySettingsProvider({ children }: { children: React.ReactNode
|
|||||||
const searchParams = new URLSearchParams(window.location.search)
|
const searchParams = new URLSearchParams(window.location.search)
|
||||||
const tempRelays = searchParams
|
const tempRelays = searchParams
|
||||||
.getAll('r')
|
.getAll('r')
|
||||||
|
.map((url) => (url.startsWith('wss://') || url.startsWith('ws://') ? url : `wss://${url}`))
|
||||||
.filter((url) => isWebsocketUrl(url))
|
.filter((url) => isWebsocketUrl(url))
|
||||||
.map((url) => normalizeUrl(url))
|
.map((url) => normalizeUrl(url))
|
||||||
if (tempRelays.length) {
|
if (tempRelays.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user