nip11: add user-agent for nostr.wine, replace dead relays

This commit is contained in:
1l0
2025-06-15 08:56:22 +09:00
committed by fiatjaf_
parent dde31e3637
commit 2f4a604975
2 changed files with 5 additions and 4 deletions

View File

@@ -36,8 +36,9 @@ func Fetch(ctx context.Context, u string) (info RelayInformationDocument, err er
// make request // make request
req, _ := http.NewRequestWithContext(ctx, "GET", "http"+u[2:], nil) 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("Accept", "application/nostr+json")
req.Header.Add("User-Agent", "https://github.com/nbd-wtf/go-nostr")
// send the request // send the request
resp, err := http.DefaultClient.Do(req) resp, err := http.DefaultClient.Do(req)

View File

@@ -45,9 +45,9 @@ func TestFetch(t *testing.T) {
{"wss://nostr.wine", false, "", "wss://nostr.wine"}, {"wss://nostr.wine", false, "", "wss://nostr.wine"},
{"https://nostr.wine", false, "", "wss://nostr.wine"}, {"https://nostr.wine", false, "", "wss://nostr.wine"},
{"nostr.wine", false, "", "wss://nostr.wine"}, {"nostr.wine", false, "", "wss://nostr.wine"},
{"no.str.cr", false, "", "wss://no.str.cr"}, {"nos.lol", false, "", "wss://nos.lol"},
{"https://no.str.cr", false, "", "wss://no.str.cr"}, {"https://nos.lol", false, "", "wss://nos.lol"},
{"wss://no.str.cr", false, "", "wss://no.str.cr"}, {"wss://nos.lol", false, "", "wss://nos.lol"},
{"wlenwqkeqwe.asjdaskd", true, "", "wss://wlenwqkeqwe.asjdaskd"}, {"wlenwqkeqwe.asjdaskd", true, "", "wss://wlenwqkeqwe.asjdaskd"},
} }