From adcab08bd771b7525aab8028c3004aba8eac0e60 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 24 Sep 2025 07:38:17 -0300 Subject: [PATCH] nip11: catch one error that wasn't. --- nip11/fetch.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nip11/fetch.go b/nip11/fetch.go index 7a31d7b..562c425 100644 --- a/nip11/fetch.go +++ b/nip11/fetch.go @@ -34,7 +34,10 @@ func Fetch(ctx context.Context, u string) (info RelayInformationDocument, err er } // make request - req, _ := http.NewRequestWithContext(ctx, "GET", "http"+u[2:], nil) + req, err := http.NewRequestWithContext(ctx, "GET", "http"+u[2:], nil) + if err != nil { + return info, fmt.Errorf("invalid request") + } // add the NIP-11 header req.Header.Add("Accept", "application/nostr+json")