Trim relay input before matching it against regex

This commit is contained in:
w3irdrobot 2022-12-08 13:20:20 -05:00
parent 16884eeb99
commit 3e1ce1489c
No known key found for this signature in database
GPG Key ID: 3F202DDAA711CD61

View File

@ -12,6 +12,7 @@
const submit = e => {
e.preventDefault()
url = url.trim()
if (!url.match(/^wss?:\/\/[\w.:-]+$/)) {
return toast.show("error", 'That isn\'t a valid websocket url - relay urls should start with "wss://"')