Some more "accept" parameters are added

This commit is contained in:
Michael 2022-03-29 06:24:20 +00:00
parent 173e72169b
commit 1fae0123ec
32 changed files with 111 additions and 60 deletions

View file

@ -25,6 +25,8 @@ use Friendica\Core\Logger;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\GServer;
use Friendica\Network\HTTPClient\Client\HttpClient;
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Util\Strings;
class UpdateServerPeers
@ -35,7 +37,7 @@ class UpdateServerPeers
*/
public static function execute(string $url)
{
$ret = DI::httpClient()->get($url . '/api/v1/instance/peers');
$ret = DI::httpClient()->get($url . '/api/v1/instance/peers', [HttpClientOptions::ACCEPT_CONTENT => HttpClient::ACCEPT_JSON]);
if (!$ret->isSuccess() || empty($ret->getBody())) {
Logger::info('Server is not reachable or does not offer the "peers" endpoint', ['url' => $url]);
return;