1
0
Fork 0

Move ACCEPT constants to own "enum" class

This commit is contained in:
Philipp Holzer 2022-04-02 20:26:11 +02:00
commit 73c3b21665
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
35 changed files with 144 additions and 138 deletions

View file

@ -25,7 +25,7 @@ use Exception;
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\HttpClientAccept;
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Util\HTTPSignature;
@ -55,7 +55,7 @@ class ExternalResource implements ICanReadFromStorage
}
try {
$fetchResult = HTTPSignature::fetchRaw($data->url, $data->uid, [HttpClientOptions::ACCEPT_CONTENT => [HttpClient::ACCEPT_IMAGE]]);
$fetchResult = HTTPSignature::fetchRaw($data->url, $data->uid, [HttpClientOptions::ACCEPT_CONTENT => [HttpClientAccept::IMAGE]]);
} catch (Exception $exception) {
throw new ReferenceStorageException(sprintf('External resource failed to get %s', $reference), $exception->getCode(), $exception);
}