Merge pull request #10260 from appwrite/update-avatars-endpoint

fix: favicons endpoint to fallback to ico instead of throwing error
This commit is contained in:
Luke B. Silver 2025-08-04 13:18:09 +01:00 committed by GitHub
commit 24a9183d90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -375,15 +375,11 @@ App::get('/v1/avatars/favicon')
throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED);
}
if ($res->getStatusCode() !== 200) {
throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED);
}
$doc = new DOMDocument();
$doc->strictErrorChecking = false;
@$doc->loadHTML($res->getBody());
$links = $doc->getElementsByTagName('link');
$links = $doc->getElementsByTagName('link') ?? [];
$outputHref = '';
$outputExt = '';
$space = 0;