diff options
Diffstat (limited to 'mod/wfinger.php')
-rw-r--r-- | mod/wfinger.php | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/mod/wfinger.php b/mod/wfinger.php index 8b9abe4af..445dbb349 100644 --- a/mod/wfinger.php +++ b/mod/wfinger.php @@ -32,7 +32,7 @@ function wfinger_init(&$a) { $channel = str_replace('acct:','',$resource); if(strpos($channel,'@') !== false) { $host = substr($channel,strpos($channel,'@')+1); - if(strcasecmp($host,get_app()->get_hostname())) { + if(strcasecmp($host,App::get_hostname())) { goaway('https://' . $host . '/.well-known/webfinger?f=&resource=' . $resource . (($zot) ? '&zot=' . $zot : '')); } $channel = substr($channel,0,strpos($channel,'@')); @@ -51,8 +51,6 @@ function wfinger_init(&$a) { header('Access-Control-Allow-Origin: *'); - header('Content-type: application/jrd+json'); - if($resource && $r) { @@ -75,13 +73,15 @@ function wfinger_init(&$a) { $result['aliases'] = array(); - $result['properties'] = array('http://webfinger.net/ns/name' => $r[0]['channel_name']); + $result['properties'] = array( + 'http://webfinger.net/ns/name' => $r[0]['channel_name'], + 'http://xmlns.com/foaf/0.1/name' => $r[0]['channel_name'] + ); foreach($aliases as $alias) if($alias != $resource) $result['aliases'][] = $alias; - $result['links'] = array( array( @@ -101,8 +101,18 @@ function wfinger_init(&$a) { ), array( + 'rel' => 'http://ostatus.org/schema/1.0/subscribe', + 'template' => z_root() . '/follow/url={uri}', + ), + + array( 'rel' => 'http://purl.org/zot/protocol', 'href' => z_root() . '/.well-known/zot-info' . '?address=' . $r[0]['xchan_addr'], + ), + + array( + 'rel' => 'magic-public-key', + 'href' => 'data:application/magic-public-key,' . salmon_key($r[0]['channel_pubkey']), ) ); @@ -119,7 +129,6 @@ function wfinger_init(&$a) { $arr = array('channel' => $r[0], 'request' => $_REQUEST, 'result' => $result); call_hooks('webfinger',$arr); - echo json_encode($arr['result']); - killme(); + json_return_and_die($arr['result'],'application/jrd+json'); -}
\ No newline at end of file +} |