Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion nip11/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions nip11/nip11_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
}

Expand Down
Loading