fix normalize and add a test.

This commit is contained in:
fiatjaf
2022-11-18 14:15:41 -03:00
parent 37b3bf7a8a
commit 0d7a4b258a
2 changed files with 31 additions and 3 deletions

View File

@@ -20,9 +20,7 @@ func NormalizeURL(u string) string {
p.Scheme = "wss"
}
if strings.HasSuffix(p.RawPath, "/") {
p.RawPath = p.RawPath[0 : len(p.RawPath)-1]
}
p.Path = strings.TrimRight(p.Path, "/")
return p.String()
}