From ac8706e919d62a3a487fe3776e03160454ca8992 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 20 May 2018 19:18:39 -0700 Subject: pleroma does not return a valid JRD when given an accept header of application/jrd+json - it only returns a JRD when passed an accept header of application/json (ahead of anything else because XRD is served at the same endpoint) --- include/network.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index ceba56e06..7e8f823a3 100644 --- a/include/network.php +++ b/include/network.php @@ -1216,7 +1216,7 @@ function webfinger_rfc7033($webbie, $zot = false) { if(strpos($webbie,'@')) { $lhs = substr($webbie,0,strpos($webbie,'@')); $rhs = substr($webbie,strpos($webbie,'@')+1); - $resource = 'acct:' . $webbie; + $resource = urlencode('acct:' . $webbie); } else { $m = parse_url($webbie); @@ -1234,7 +1234,7 @@ function webfinger_rfc7033($webbie, $zot = false) { $counter = 0; $s = z_fetch_url('https://' . $rhs . '/.well-known/webfinger?f=&resource=' . $resource . (($zot) ? '&zot=1' : ''), - false, $counter, [ 'headers' => [ 'Accept: application/jrd+json, */*' ] ]); + false, $counter, [ 'headers' => [ 'Accept: application/jrd+json, application/json, */*' ] ]); if($s['success']) { $j = json_decode($s['body'], true); -- cgit v1.2.3