X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FModule%2FFriendica.php;h=3fccda5f859ddd429adb34a8e21e23e3c521ca83;hb=d7df0825db598012871d8555de04575d0c30247a;hp=7da02808962969292e2459a52bf8aee726de3cb2;hpb=122ad0af14f046c2462a03fe33967dc41abfc8b5;p=friendica.git diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index 7da0280896..3fccda5f85 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -1,6 +1,6 @@ getArgc() <= 1 || (DI::args()->getArgv()[1] !== 'json')) { + if (!ActivityPub::isRequest()) { + return; + } + + try { + $data = ActivityPub\Transmitter::getProfile(0); header('Access-Control-Allow-Origin: *'); header('Cache-Control: max-age=23200, stale-while-revalidate=23200'); System::jsonExit($data, 'application/activity+json'); + } catch (HTTPException\NotFoundException $e) { + System::jsonError(404, ['error' => 'Record not found']); } } - $app = DI::app(); - - // @TODO: Replace with parameter from router - if ($app->argc <= 1 || ($app->argv[1] !== 'json')) { - return; - } - $config = DI::config(); $register_policies = [