diff --git a/app/Services/ActivityPubService.php b/app/Services/ActivityPubService.php index 3784e2641..61866c43d 100644 --- a/app/Services/ActivityPubService.php +++ b/app/Services/ActivityPubService.php @@ -101,14 +101,16 @@ protected function fetchActivityPub($url, $params, $signed, $validateContentType 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', ]; - $contentType = $res->header('Content-Type')[0]; + /** @var string|null $contentType */ + $contentType = $res->header('Content-Type'); if ($validateContentType) { - if (! $contentType) { + if ($contentType === null) { return false; } - if (in_array($contentType, $acceptedTypes)) { + // Check if NOT in accepted types + if (! in_array($contentType, $acceptedTypes)) { return false; } }