mirror of
https://github.com/friendica/friendica
synced 2025-04-25 18:30:11 +00: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
|
@ -34,6 +34,8 @@ use Friendica\Core\System;
|
|||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClient;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
|
||||
use Friendica\Security\TwoFactor\Model\AppSpecificPassword;
|
||||
use Friendica\Network\HTTPException;
|
||||
use Friendica\Object\Image;
|
||||
|
@ -1150,8 +1152,9 @@ class User
|
|||
$photo_failure = false;
|
||||
|
||||
$filename = basename($photo);
|
||||
$curlResult = DI::httpClient()->get($photo);
|
||||
$curlResult = DI::httpClient()->get($photo, [HttpClientOptions::ACCEPT_CONTENT => HttpClient::ACCEPT_IMAGE]);
|
||||
if ($curlResult->isSuccess()) {
|
||||
Logger::debug('Got picture', ['Content-Type' => $curlResult->getHeader('Content-Type'), 'url' => $photo]);
|
||||
$img_str = $curlResult->getBody();
|
||||
$type = $curlResult->getContentType();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue