mirror of https://github.com/friendica/friendica
Move Content-Type check before JSON decode in ActivityPub\Processor::fetchMissingActivity
This commit is contained in:
parent
54852ecb56
commit
6ab43439f4
|
@ -1603,6 +1603,11 @@ class Processor
|
|||
return '';
|
||||
}
|
||||
|
||||
if (!HTTPSignature::isValidContentType($curlResult->getContentType())) {
|
||||
Logger::notice('Unexpected content type', ['content-type' => $curlResult->getContentType(), 'url' => $url]);
|
||||
return '';
|
||||
}
|
||||
|
||||
$object = json_decode($body, true);
|
||||
|
||||
if (!empty($object)) {
|
||||
|
@ -1618,11 +1623,6 @@ class Processor
|
|||
return '';
|
||||
}
|
||||
|
||||
if (!HTTPSignature::isValidContentType($curlResult->getContentType())) {
|
||||
Logger::notice('Unexpected content type', ['content-type' => $curlResult->getContentType(), 'url' => $url]);
|
||||
return '';
|
||||
}
|
||||
|
||||
$ldobject = JsonLD::compact($object);
|
||||
|
||||
$signer = [];
|
||||
|
|
Loading…
Reference in New Issue