Check for activity pub mime types

This commit is contained in:
Michael 2024-02-19 07:11:56 +00:00
parent cb294cf411
commit 892e0a5623
3 changed files with 24 additions and 5 deletions

View file

@ -208,6 +208,9 @@ class APContact
if (!$failed && ($curlResult->getReturnCode() == 410)) {
$data = ['@context' => ActivityPub::CONTEXT, 'id' => $url, 'type' => 'Tombstone'];
} elseif (!$failed && !HTTPSignature::isValidContentType($curlResult->getContentType())) {
Logger::debug('Unexpected content type', ['content-type' => $curlResult->getContentType(), 'url' => $url]);
$failed = true;
}
} catch (\Exception $exception) {
Logger::notice('Error fetching url', ['url' => $url, 'exception' => $exception]);