mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-17 21:32:56 +01:00
feat: add check redirect for identifier request
This commit is contained in:
parent
b278230cdb
commit
17a7c3a678
@ -37,8 +37,12 @@ func QueryIdentifier(fullname string) *nostr.ProfilePointer {
|
||||
if strings.Index(domain, ".") == -1 {
|
||||
return nil
|
||||
}
|
||||
|
||||
res, err := http.Get(fmt.Sprintf("https://%s/.well-known/nostr.json?name=%s", domain, name))
|
||||
client := &http.Client{
|
||||
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
||||
return http.ErrUseLastResponse
|
||||
},
|
||||
}
|
||||
res, err := client.Get(fmt.Sprintf("https://%s/.well-known/nostr.json?name=%s", domain, name))
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user