improve relay URL normalization.

This commit is contained in:
fiatjaf 2023-03-14 21:54:25 -03:00
parent 7803cc74b3
commit 5e24b24442
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1

View File

@ -11,6 +11,9 @@ func NormalizeURL(u string) string {
return ""
}
u = strings.TrimSpace(u)
u = strings.ToLower(u)
if !strings.HasPrefix(u, "http") && !strings.HasPrefix(u, "ws") {
u = "wss://" + u
}