Some more "accept" parameters are added
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user