mirror of
https://github.com/friendica/friendica
synced 2025-05-05 10:24:09 +02:00
Some more "accept" parameters are added
This commit is contained in:
parent
173e72169b
commit
1fae0123ec
32 changed files with 111 additions and 60 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue