aboutsummaryrefslogtreecommitdiffstats
path: root/mod/probe.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/probe.php')
-rw-r--r--mod/probe.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/mod/probe.php b/mod/probe.php
index 397f571c5..bd792d52e 100644
--- a/mod/probe.php
+++ b/mod/probe.php
@@ -15,9 +15,16 @@ function probe_content(&$a) {
if(x($_GET,'addr')) {
$channel = $a->get_channel();
$addr = trim($_GET['addr']);
- $res = zot_finger($addr,$channel);
+ $res = zot_finger($addr,$channel,false);
$o .= '<pre>';
- $j = json_decode($res['body'],true);
+ if($res['success'])
+ $j = json_decode($res['body'],true);
+ else {
+ $o .= "<strong>https connection failed. Trying again with auto failover to http.</strong>\r\n\r\n";
+ $res = zot_finger($addr,$channel,true);
+ if($res['success'])
+ $j = json_decode($res['body'],true);
+ }
if($j && $j['permissions'] && $j['permissions']['iv'])
$j['permissions'] = json_decode(aes_unencapsulate($j['permissions'],$channel['channel_prvkey']),true);
$o .= str_replace("\n",'<br />',print_r($j,true));