Use "HttpClientOptions"

This commit is contained in:
Michael 2022-03-29 08:57:38 +00:00
parent 1fae0123ec
commit 908d2594ed
5 changed files with 9 additions and 7 deletions

View file

@ -26,6 +26,7 @@ use Friendica\Core\Logger;
use Friendica\Core\Storage\Exception\ReferenceStorageException;
use Friendica\Core\Storage\Capability\ICanReadFromStorage;
use Friendica\Network\HTTPClient\Client\HttpClient;
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Util\HTTPSignature;
/**
@ -54,7 +55,7 @@ class ExternalResource implements ICanReadFromStorage
}
try {
$fetchResult = HTTPSignature::fetchRaw($data->url, $data->uid, ['accept_content' => [HttpClient::ACCEPT_IMAGE]]);
$fetchResult = HTTPSignature::fetchRaw($data->url, $data->uid, [HttpClientOptions::ACCEPT_CONTENT => [HttpClient::ACCEPT_IMAGE]]);
} catch (Exception $exception) {
throw new ReferenceStorageException(sprintf('External resource failed to get %s', $reference), $exception->getCode(), $exception);
}