diff --git a/src/Module/ActivityPub/Objects.php b/src/Module/ActivityPub/Objects.php index 34d460951..f93c8b957 100644 --- a/src/Module/ActivityPub/Objects.php +++ b/src/Module/ActivityPub/Objects.php @@ -46,6 +46,8 @@ class Objects extends BaseModule throw new HTTPException\BadRequestException(); } + header('Vary: Accept', false); + if (!ActivityPub::isRequest()) { DI::baseUrl()->redirect(str_replace('objects/', 'display/', DI::args()->getQueryString())); } diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index 90869878e..73d5f633c 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -115,6 +115,8 @@ class Friendica extends BaseModule protected function rawContent(array $request = []) { + header('Vary: Accept', false); + // @TODO: Replace with parameter from router if (DI::args()->getArgc() <= 1 || (DI::args()->getArgv()[1] !== 'json')) { if (!ActivityPub::isRequest()) { diff --git a/src/Module/Item/Display.php b/src/Module/Item/Display.php index b2ed43c5b..a0d1ecbf5 100644 --- a/src/Module/Item/Display.php +++ b/src/Module/Item/Display.php @@ -88,6 +88,8 @@ class Display extends BaseModule protected function content(array $request = []): string { + header('Vary: Accept', false); + if (ActivityPub::isRequest()) { $this->baseUrl->redirect(str_replace('display/', 'objects/', $this->args->getQueryString())); } diff --git a/src/Module/Profile/Profile.php b/src/Module/Profile/Profile.php index 5e5028cb8..31ef8d05b 100644 --- a/src/Module/Profile/Profile.php +++ b/src/Module/Profile/Profile.php @@ -80,6 +80,8 @@ class Profile extends BaseProfile protected function rawContent(array $request = []) { + header('Vary: Accept', false); + if (ActivityPub::isRequest()) { $user = $this->database->selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname'] ?? '', 'account_removed' => false]); if ($user) { diff --git a/src/Module/Xrd.php b/src/Module/Xrd.php index 6a4c0e860..3267e9e9a 100644 --- a/src/Module/Xrd.php +++ b/src/Module/Xrd.php @@ -80,6 +80,8 @@ class Xrd extends BaseModule throw new NotFoundException('Invalid host name for xrd query: ' . $host); } + header('Vary: Accept', false); + if ($name == User::getActorName()) { $owner = User::getSystemAccount(); if (empty($owner)) { @@ -326,7 +328,6 @@ class Xrd extends BaseModule ]); header('Access-Control-Allow-Origin: *'); - System::httpExit($xmlString, Response::TYPE_XML, 'application/xrd+xml'); } }