diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 33959e1e5..60d6412b4 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -19,6 +19,7 @@ use Friendica\Model\Contact; use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\User; +use Friendica\Network\HTTPClient\Client\HttpClientAccept; use Friendica\Protocol\Activity; use Friendica\Util\DateTimeFormat; @@ -207,7 +208,7 @@ function mailstream_do_images(&$item, &$attachments) continue; } $cookiejar = tempnam(System::getTempPath(), 'cookiejar-mailstream-'); - $curlResult = DI::httpClient()->fetchFull($url, 0, '', $cookiejar); + $curlResult = DI::httpClient()->fetchFull($url, HttpClientAccept::DEFAULT, 0, $cookiejar); $attachments[$url] = [ 'data' => $curlResult->getBody(), 'guid' => hash("crc32", $url), diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 62ad77120..1253d376a 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -22,6 +22,7 @@ use Friendica\Model\Group; use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\User; +use Friendica\Network\HTTPClient\Client\HttpClientAccept; use Friendica\Network\HTTPClient\Client\HttpClientOptions; use Friendica\Protocol\Activity; use Friendica\Protocol\ActivityNamespace; @@ -1487,7 +1488,7 @@ function pumpio_fetchallcomments(App $a, $uid, $id) function pumpio_reachable($url) { - return DI::httpClient()->get($url, [HttpClientOptions::TIMEOUT => 10])->isSuccess(); + return DI::httpClient()->get($url, HttpClientAccept::DEFAULT, [HttpClientOptions::TIMEOUT => 10])->isSuccess(); } /* diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index b2582b86e..6fc1469c2 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -56,6 +56,7 @@ use Friendica\Model\Item; use Friendica\Model\Photo; use Friendica\Model\Post; use Friendica\Model\User; +use Friendica\Network\HTTPClient\Client\HttpClientAccept; use Friendica\Protocol\Activity; use Friendica\Util\DateTimeFormat; use Friendica\Util\Strings; @@ -1367,7 +1368,7 @@ function statusnet_convertmsg(App $a, $body) } elseif ($oembed_data->type != "link") { $body = str_replace($search, "[url=" . $expanded_url . "]" . $expanded_url . "[/url]", $body); } else { - $img_str = DI::httpClient()->fetch($expanded_url, 4); + $img_str = DI::httpClient()->fetch($expanded_url, HttpClientAccept::DEFAULT, 4); $tempfile = tempnam(System::getTempPath(), "cache"); file_put_contents($tempfile, $img_str);