From f924d38d8c2b79e4bfe8df438894ff1ad636e411 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 25 Mar 2014 16:44:19 -0700 Subject: webfinger enhancements: per RFC7033 --- mod/_well_known.php | 2 ++ mod/wfinger.php | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'mod') diff --git a/mod/_well_known.php b/mod/_well_known.php index 6e77336c3..c5a38078a 100644 --- a/mod/_well_known.php +++ b/mod/_well_known.php @@ -19,6 +19,8 @@ function _well_known_init(&$a){ require_once('mod/wfinger.php'); wfinger_init($a); break; + default: + break; } } diff --git a/mod/wfinger.php b/mod/wfinger.php index fb75da193..bdec92b54 100644 --- a/mod/wfinger.php +++ b/mod/wfinger.php @@ -1,7 +1,7 @@ get_hostname())) { + goaway('https://' . $host . '/.well-known/webfinger?resource=' . $resource); + } + $channel = substr($channel,0,strpos($channel,'@')); + } } if(strpos($resource,'http') === 0) { $channel = str_replace('~','',basename($resource)); @@ -43,6 +46,13 @@ function wfinger_init(&$a) { } + + header('Access-Control-Allow-Origin: *'); + + header('Content-type: application/jrd+json'); + + + if($resource && $r) { $result['subject'] = $resource; @@ -55,6 +65,8 @@ function wfinger_init(&$a) { $result['aliases'] = array(); + $result['properties'] = array('http://webfinger.example/ns/name' => $r[0]['channel_name']); + foreach($aliases as $alias) if($alias != $resource) $result['aliases'][] = $alias; -- cgit v1.2.3