mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-17 21:32:56 +01:00
NormalizeURL() shouldn't lowercase paths.
This commit is contained in:
parent
7be028ff7c
commit
adb97d46a7
@ -13,8 +13,6 @@ func NormalizeURL(u string) string {
|
||||
}
|
||||
|
||||
u = strings.TrimSpace(u)
|
||||
u = strings.ToLower(u)
|
||||
|
||||
if fqn := strings.Split(u, ":")[0]; fqn == "localhost" || fqn == "127.0.0.1" {
|
||||
u = "ws://" + u
|
||||
} else if !strings.HasPrefix(u, "http") && !strings.HasPrefix(u, "ws") {
|
||||
@ -32,6 +30,7 @@ func NormalizeURL(u string) string {
|
||||
p.Scheme = "wss"
|
||||
}
|
||||
|
||||
p.Host = strings.ToLower(p.Host)
|
||||
p.Path = strings.TrimRight(p.Path, "/")
|
||||
|
||||
return p.String()
|
||||
|
Loading…
x
Reference in New Issue
Block a user