From bc025489991d506ef0d0ed19d16ccba7ef9488ce Mon Sep 17 00:00:00 2001 From: Shlee Date: Fri, 9 Jan 2026 23:12:51 +0700 Subject: [PATCH 1/2] Update ActivityPubService.php --- app/Services/ActivityPubService.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Services/ActivityPubService.php b/app/Services/ActivityPubService.php index 3784e2641..f1a53058a 100644 --- a/app/Services/ActivityPubService.php +++ b/app/Services/ActivityPubService.php @@ -101,14 +101,15 @@ protected function fetchActivityPub($url, $params, $signed, $validateContentType 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', ]; - $contentType = $res->header('Content-Type')[0]; + $contentType = $res->header('Content-Type'); if ($validateContentType) { if (! $contentType) { return false; } - if (in_array($contentType, $acceptedTypes)) { + // Check if NOT in accepted types + if (! in_array($contentType, $acceptedTypes)) { return false; } } From 1584422fc7e6beca171258aa1795f711560a3fe7 Mon Sep 17 00:00:00 2001 From: Shlee Date: Sat, 10 Jan 2026 09:08:47 +0700 Subject: [PATCH 2/2] Update ActivityPubService.php --- app/Services/ActivityPubService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/ActivityPubService.php b/app/Services/ActivityPubService.php index f1a53058a..61866c43d 100644 --- a/app/Services/ActivityPubService.php +++ b/app/Services/ActivityPubService.php @@ -101,10 +101,11 @@ protected function fetchActivityPub($url, $params, $signed, $validateContentType 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', ]; + /** @var string|null $contentType */ $contentType = $res->header('Content-Type'); if ($validateContentType) { - if (! $contentType) { + if ($contentType === null) { return false; }