]> git.mxchange.org Git - friendica.git/commitdiff
Issue 6212: No need of a redirect for fetching content
authorMichael <heluecht@pirati.ca>
Thu, 29 Nov 2018 15:06:00 +0000 (15:06 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 29 Nov 2018 15:06:00 +0000 (15:06 +0000)
mod/display.php

index 39661cb76fccc9cf696705f26852c1a544d37934..1bb2a6ec81f4b6c19a7b5bc7218bc31fd26b9baf 100644 (file)
@@ -82,7 +82,16 @@ function display_init(App $a)
        }
 
        if (ActivityPub::isRequest()) {
-               $a->internalRedirect(str_replace('display/', 'objects/', $a->query_string));
+               $item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'origin' => true, 'private' => false]);
+               if (!DBA::isResult($item)) {
+                       System::httpExit(404);
+               }
+
+               $data = ActivityPub\Transmitter::createObjectFromItemID($item['id']);
+
+               header('Content-Type: application/activity+json');
+               echo json_encode($data);
+               exit();
        }
 
        if ($item["id"] != $item["parent"]) {