t('Zot6 Probe Diagnostic'), '$resource' => [ 'resource', t('Object URL') , $_REQUEST['resource'], EMPTY_STR ], '$authf' => [ 'authf', t('Authenticated fetch'), $_REQUEST['authf'], EMPTY_STR, [ t('No'), t('Yes') ] ], '$submit' => t('Submit') ]); if(x($_GET,'resource')) { $resource = $_GET['resource']; $channel = (($_GET['authf']) ? \App::get_channel() : null); if(strpos($resource,'x-zot:') === 0) { $x = ZotURL::fetch($resource,$channel); } else { $x = Zotfinger::exec($resource,$channel); $o .= '
' . htmlspecialchars(print_array($x)) . '
'; $headers = 'Accept: application/x-zot+json, application/jrd+json, application/json'; $redirects = 0; $x = z_fetch_url($resource,true,$redirects, [ 'headers' => [ $headers ]]); } if($x['success']) { $o .= '
' . htmlspecialchars($x['header']) . '
' . EOL; $o .= 'verify returns: ' . str_replace("\n",EOL,print_r(HTTPSig::verify($x, EMPTY_STR, 'zot6'),true)) . EOL; $o .= '
' . htmlspecialchars(json_encode(json_decode($x['body']),JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES)) . '
' . EOL; } } return $o; } }