From 51b2bf6f70c45a445bc83fd1b190eb758334d5ba Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 28 Mar 2022 13:12:45 +0000 Subject: [PATCH] Avoid returning of the actor when requesting friendica/json --- src/Module/Friendica.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index 87edf14ca8..3fccda5f85 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -112,7 +112,12 @@ class Friendica extends BaseModule protected function rawContent(array $request = []) { - if (ActivityPub::isRequest()) { + // @TODO: Replace with parameter from router + if (DI::args()->getArgc() <= 1 || (DI::args()->getArgv()[1] !== 'json')) { + if (!ActivityPub::isRequest()) { + return; + } + try { $data = ActivityPub\Transmitter::getProfile(0); header('Access-Control-Allow-Origin: *'); @@ -123,11 +128,6 @@ class Friendica extends BaseModule } } - // @TODO: Replace with parameter from router - if (DI::args()->getArgc() <= 1 || (DI::args()->getArgv()[1] !== 'json')) { - return; - } - $config = DI::config(); $register_policies = [