diff options
author | zotlabs <mike@macgirvin.com> | 2018-04-16 23:32:40 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-04-16 23:32:40 -0700 |
commit | 8b9952e770a6a0245a2b8a1a41214b9fec440e08 (patch) | |
tree | 427de98bb239a3c55baaddf06bc0583d81ef12b3 /include/network.php | |
parent | 43e55eb9a6cb66ad040064fca8b8296bcd298a03 (diff) | |
download | volse-hubzilla-8b9952e770a6a0245a2b8a1a41214b9fec440e08.tar.gz volse-hubzilla-8b9952e770a6a0245a2b8a1a41214b9fec440e08.tar.bz2 volse-hubzilla-8b9952e770a6a0245a2b8a1a41214b9fec440e08.zip |
set the correct webfinger Accept: request header now that Mastodon fixed the bug that we changed it to work around
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/include/network.php b/include/network.php index 747b46877..897fbccd6 100644 --- a/include/network.php +++ b/include/network.php @@ -1240,16 +1240,9 @@ function webfinger_rfc7033($webbie, $zot = false) { } logger('fetching url from resource: ' . $rhs . ':' . $webbie); - // The default curl Accept: header is */*, which is incorrectly handled by Mastodon servers - // and results in a 406 (Not Acceptable) response, and will also incorrectly produce an XML - // document if you use 'application/jrd+json, */*'. We could set this to application/jrd+json, - // but some test webfinger servers may not explicitly set the content type and they would be - // blocked. The best compromise until Mastodon is fixed is to remove the Accept header which is - // accomplished by setting it to nothing. - $counter = 0; $s = z_fetch_url('https://' . $rhs . '/.well-known/webfinger?f=&resource=' . $resource . (($zot) ? '&zot=1' : ''), - false, $counter, [ 'headers' => [ 'Accept:' ] ]); + false, $counter, [ 'headers' => [ 'Accept: application/jrd+json, */*' ] ]); if($s['success']) { $j = json_decode($s['body'], true); |