fix localhost trick from 8aaf5b.

This commit is contained in:
fiatjaf
2024-07-04 16:29:04 -03:00
parent f9fd760808
commit 92b85c9483
2 changed files with 4 additions and 5 deletions

View File

@@ -23,11 +23,11 @@ var urlTests = []urlTest{
{"x.com/?x=23", "wss://x.com?x=23"},
{"localhost:4036", "ws://localhost:4036"},
{"localhost:4036/relay", "ws://localhost:4036/relay"},
{"localhostmagnanimus.com", "wss://localhostmagnanimus.com"},
{NormalizeURL("localhost:4036/relay"), "ws://localhost:4036/relay"},
}
func TestNormalizeURL(t *testing.T) {
for _, test := range urlTests {
if output := NormalizeURL(test.url); output != test.expected {
t.Errorf("Output '%s' not equal to expected '%s'", output, test.expected)