diff --git a/nip11/fetch.go b/nip11/fetch.go index a679f14..9d13dfb 100644 --- a/nip11/fetch.go +++ b/nip11/fetch.go @@ -36,8 +36,9 @@ func Fetch(ctx context.Context, u string) (info RelayInformationDocument, err er // make request req, _ := http.NewRequestWithContext(ctx, "GET", "http"+u[2:], nil) - // add the NIP-11 header + // add the NIP-11 headers req.Header.Add("Accept", "application/nostr+json") + req.Header.Add("User-Agent", "https://github.com/nbd-wtf/go-nostr") // send the request resp, err := http.DefaultClient.Do(req) diff --git a/nip11/nip11_test.go b/nip11/nip11_test.go index 1a3ca69..f2019be 100644 --- a/nip11/nip11_test.go +++ b/nip11/nip11_test.go @@ -45,9 +45,9 @@ func TestFetch(t *testing.T) { {"wss://nostr.wine", false, "", "wss://nostr.wine"}, {"https://nostr.wine", false, "", "wss://nostr.wine"}, {"nostr.wine", false, "", "wss://nostr.wine"}, - {"no.str.cr", false, "", "wss://no.str.cr"}, - {"https://no.str.cr", false, "", "wss://no.str.cr"}, - {"wss://no.str.cr", false, "", "wss://no.str.cr"}, + {"nos.lol", false, "", "wss://nos.lol"}, + {"https://nos.lol", false, "", "wss://nos.lol"}, + {"wss://nos.lol", false, "", "wss://nos.lol"}, {"wlenwqkeqwe.asjdaskd", true, "", "wss://wlenwqkeqwe.asjdaskd"}, }