diff --git a/nip11/fetch.go b/nip11/fetch.go index 562c425..065913a 100644 --- a/nip11/fetch.go +++ b/nip11/fetch.go @@ -41,6 +41,7 @@ func Fetch(ctx context.Context, u string) (info RelayInformationDocument, err er // add the NIP-11 header req.Header.Add("Accept", "application/nostr+json") + req.Header.Add("User-Agent", "nostrlib/go") // send the request resp, err := http.DefaultClient.Do(req) diff --git a/sdk/specific_event.go b/sdk/specific_event.go index cad0c94..1742200 100644 --- a/sdk/specific_event.go +++ b/sdk/specific_event.go @@ -91,6 +91,8 @@ func (sys *System) FetchSpecificEvent( relays = nostr.AppendUnique(relays, sys.FallbackRelays.Next()) fallback = append(fallback, sys.FallbackRelays.Next(), sys.FallbackRelays.Next()) priorityRelays = append(priorityRelays, v.Relays...) + default: + return nil, nil, fmt.Errorf("can't call sys.FetchSpecificEvent() with a %v", pointer) } // try to fetch in our internal eventstore first