Added 'Accept: application/json' to every “gurl” call

This commit is contained in:
pezcurrel 2023-12-31 23:16:16 +01:00
parent 63c619399d
commit 618ebfa54b

View file

@ -256,7 +256,7 @@ function crawl(&$list,$id) {
updexarr($id);
waituntilonline($id);
lecho(1,'round '.$id.': trying to load instance «'.$inst.s peers...'.N);
$peers=gurl('https://'.$inst.'/api/v1/instance/peers',$opts['conntimeout'],$opts['functimeout']);
$peers=gurl('https://'.$inst.'/api/v1/instance/peers',$opts['conntimeout'],$opts['functimeout'],['Accept: application/json']);
if ($peers['cont']===false) {
lecho(2,'round '.$id.': could not load instance «'.$inst.s peers: '.$peers['emsg'].'.'.N);
} else {
@ -296,7 +296,7 @@ function crawl(&$list,$id) {
}
if (!$responded) {
lecho(1,'round '.$id.': instance «'.$inst.'» didnt respond at its “peers” endpoint; trying to load its info from “instance” endpoint...'.N);
$instinfo=gurl('https://'.$inst.'/api/v1/instance',$opts['conntimeout'],$opts['functimeout']);
$instinfo=gurl('https://'.$inst.'/api/v1/instance',$opts['conntimeout'],$opts['functimeout'],['Accept: application/json']);
if ($instinfo['cont']===false) {
lecho(2,'round '.$id.': could not load instance «'.$inst.s info: '.$instinfo['emsg'].'.'.N);
} else {