Introduce "accept_header" as specific argument to the http client

This commit is contained in:
Philipp 2022-04-02 21:16:22 +02:00
parent 73c3b21665
commit e299fc67c8
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
35 changed files with 150 additions and 150 deletions

View file

@ -35,7 +35,6 @@ use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Security\TwoFactor\Model\AppSpecificPassword;
use Friendica\Network\HTTPException;
use Friendica\Object\Image;
@ -1152,7 +1151,7 @@ class User
$photo_failure = false;
$filename = basename($photo);
$curlResult = DI::httpClient()->get($photo, [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::IMAGE]);
$curlResult = DI::httpClient()->get($photo, HttpClientAccept::IMAGE);
if ($curlResult->isSuccess()) {
Logger::debug('Got picture', ['Content-Type' => $curlResult->getHeader('Content-Type'), 'url' => $photo]);
$img_str = $curlResult->getBody();