]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/UpdateServerPeers.php
doc/themes.md,FAQ-admin: point to live friendica-themes.com mirror
[friendica.git] / src / Worker / UpdateServerPeers.php
index e058506b8636359ef08af691145b09ca08f69809..d2a127b82fdfeb77e10e94bbe01589a06b3af0b2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -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;