diff options
author | zottel <github@zottel.net> | 2015-09-18 09:38:55 +0200 |
---|---|---|
committer | zottel <github@zottel.net> | 2015-09-18 09:38:55 +0200 |
commit | 4d05d477f8363aceb08d533c79d048b4e7be1fa3 (patch) | |
tree | 3646350c02e363b77ab63a089a6803a4bfdb67ed /mod/wfinger.php | |
parent | 3017dbc8c1058c9a1258a19aff39d3833d5d038c (diff) | |
parent | cc95c3e9c81a11d96b6670180f53490ec30e0324 (diff) | |
download | volse-hubzilla-4d05d477f8363aceb08d533c79d048b4e7be1fa3.tar.gz volse-hubzilla-4d05d477f8363aceb08d533c79d048b4e7be1fa3.tar.bz2 volse-hubzilla-4d05d477f8363aceb08d533c79d048b4e7be1fa3.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/wfinger.php')
-rw-r--r-- | mod/wfinger.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/mod/wfinger.php b/mod/wfinger.php index 7b9eaa461..8b9abe4af 100644 --- a/mod/wfinger.php +++ b/mod/wfinger.php @@ -1,5 +1,7 @@ <?php +require_once('include/zot.php'); + function wfinger_init(&$a) { $result = array(); @@ -11,14 +13,13 @@ function wfinger_init(&$a) { elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443)) $scheme = 'https'; - // Don't complain to me - I'm just implementing the spec. + $zot = intval($_REQUEST['zot']); - if($scheme !== 'https') { + if(($scheme !== 'https') && (! $zot)) { header($_SERVER["SERVER_PROTOCOL"] . ' ' . 500 . ' ' . 'Webfinger requires HTTPS'); killme(); } - $zot = intval($_REQUEST['zot']); $resource = $_REQUEST['resource']; logger('webfinger: ' . $resource,LOGGER_DEBUG); @@ -48,7 +49,6 @@ function wfinger_init(&$a) { } - header('Access-Control-Allow-Origin: *'); header('Content-type: application/jrd+json'); @@ -107,11 +107,8 @@ function wfinger_init(&$a) { ); if($zot) { - // @FIXME do a lookup straightaway and return the zot-info packet - - $_REQUEST['address'] = $r[0]['xchan_address']; - - + // get a zotinfo packet and return it with webfinger + $result['zot'] = zotinfo(array('address' => $r[0]['xchan_addr'])); } } else { |