mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-08-23 12:12:04 +02:00
nip11: add user-agent for nostr.wine, replace dead relays
This commit is contained in:
@@ -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)
|
||||
|
@@ -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"},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user