mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-28 18:51:53 +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 {
|
if strings.Index(domain, ".") == -1 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
client := &http.Client{
|
||||||
res, err := http.Get(fmt.Sprintf("https://%s/.well-known/nostr.json?name=%s", domain, name))
|
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 {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user