Request type set for all HTTP requests

This commit is contained in:
Michael 2024-05-12 17:53:21 +00:00
parent d788cb82cc
commit 5751e024c0
30 changed files with 129 additions and 90 deletions

View file

@ -369,7 +369,7 @@ class Photo extends BaseApi
$update = in_array($contact['network'], Protocol::FEDERATED) && !$contact['failed']
&& ((time() - strtotime($contact['updated']) > 86400));
if ($update) {
$curlResult = DI::httpClient()->head($url, [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::IMAGE, HttpClientOptions::REQUEST => HttpClientRequest::MEDIAPROXY]);
$curlResult = DI::httpClient()->head($url, [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::IMAGE, HttpClientOptions::REQUEST => HttpClientRequest::CONTENTTYPE]);
$update = !$curlResult->isSuccess() && ($curlResult->getReturnCode() == 404);
Logger::debug('Got return code for avatar', ['return code' => $curlResult->getReturnCode(), 'cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
}