Introduce "accept_header" as specific argument to the http client

This commit is contained in:
Philipp 2022-04-02 21:16:22 +02:00
parent 73c3b21665
commit e299fc67c8
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
35 changed files with 150 additions and 150 deletions

View file

@ -45,7 +45,7 @@ class UpdateServerDirectory
private static function discoverPoCo(array $gserver)
{
$result = DI::httpClient()->fetch($gserver['poco'] . '?fields=urls', 0, HttpClientAccept::JSON);
$result = DI::httpClient()->fetch($gserver['poco'] . '?fields=urls', HttpClientAccept::JSON);
if (empty($result)) {
Logger::info('Empty result', ['url' => $gserver['url']]);
return;
@ -78,7 +78,7 @@ class UpdateServerDirectory
private static function discoverMastodonDirectory(array $gserver)
{
$result = DI::httpClient()->fetch($gserver['url'] . '/api/v1/directory?order=new&local=true&limit=200&offset=0', 0, HttpClientAccept::JSON);
$result = DI::httpClient()->fetch($gserver['url'] . '/api/v1/directory?order=new&local=true&limit=200&offset=0', HttpClientAccept::JSON);
if (empty($result)) {
Logger::info('Empty result', ['url' => $gserver['url']]);
return;