Reject relay address with missing host

This commit is contained in:
Viktor Liu
2026-05-06 11:35:42 +02:00
parent a61a04a9f5
commit 67dc18e14c

View File

@@ -66,6 +66,9 @@ func prepareURL(address string) (string, error) {
default:
return "", fmt.Errorf("unsupported scheme: %s", parsed.Scheme)
}
if parsed.Host == "" {
return "", fmt.Errorf("missing host in relay address %q", address)
}
parsed.Path = relay.WebSocketURLPath
return parsed.String(), nil
}