From 761bdafa34bfdf1b2b43a3f06ae092e0925898ac Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 30 Sep 2018 14:13:07 +0000 Subject: [PATCH] Correct content type --- mod/profile.php | 1 + src/Protocol/ActivityPub.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/profile.php b/mod/profile.php index 8df63705e4..e20836a059 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -55,6 +55,7 @@ function profile_init(App $a) if (DBA::isResult($user)) { $data = ActivityPub::profile($user['uid']); echo json_encode($data); + header('Content-Type: application/activity+json'); exit(); } } diff --git a/src/Protocol/ActivityPub.php b/src/Protocol/ActivityPub.php index ab5da4666c..cf9ca3dd43 100644 --- a/src/Protocol/ActivityPub.php +++ b/src/Protocol/ActivityPub.php @@ -834,8 +834,9 @@ class ActivityPub { $ret = Network::curl($url, false, $redirects, ['accept_content' => 'application/activity+json, application/ld+json']); if (!$ret['success'] || empty($ret['body'])) { - return; + return false; } + return json_decode($ret['body'], true); }