Update NodeinfoService, disable redirects

This commit is contained in:
Daniel Supernault 2024-02-07 02:47:34 -07:00
parent 80e0ada946
commit 240e6bbe4f
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -22,7 +22,10 @@ class NodeinfoService
$wk = $url . '/.well-known/nodeinfo'; $wk = $url . '/.well-known/nodeinfo';
try { try {
$res = Http::withHeaders($headers) $res = Http::withOptions([
'allow_redirects' => false,
])
->withHeaders($headers)
->timeout(5) ->timeout(5)
->get($wk); ->get($wk);
} catch (RequestException $e) { } catch (RequestException $e) {
@ -61,7 +64,10 @@ class NodeinfoService
} }
try { try {
$res = Http::withHeaders($headers) $res = Http::withOptions([
'allow_redirects' => false,
])
->withHeaders($headers)
->timeout(5) ->timeout(5)
->get($href); ->get($href);
} catch (RequestException $e) { } catch (RequestException $e) {