nip11: url normalization improvement and Fetch test.
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package nip11
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAddSupportedNIP(t *testing.T) {
|
||||
info := RelayInformationDocument{}
|
||||
@@ -28,3 +31,14 @@ func TestAddSupportedNIP(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFetch(t *testing.T) {
|
||||
res, err := Fetch(context.Background(), "wss://relay.nostr.bg")
|
||||
if err != nil || res.Name == "" {
|
||||
t.Errorf("failed to fetch from wss")
|
||||
}
|
||||
res, err = Fetch(context.Background(), "https://relay.nostr.bg")
|
||||
if err != nil || res.Name == "" {
|
||||
t.Errorf("failed to fetch from https")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user