mod_ap_probe: return curl error info if fetch fails

This commit is contained in:
nobody 2021-09-16 21:16:08 -07:00
parent 009e457f36
commit 4327c7844c
2 changed files with 5 additions and 2 deletions

View file

@ -73,7 +73,7 @@ class Activity {
static function fetch($url,$channel = null,$hub = null) {
static function fetch($url,$channel = null,$hub = null,$debug = false) {
$redirects = 0;
if (! check_siteallowed($url)) {
logger('denied: ' . $url);
@ -165,6 +165,9 @@ class Activity {
}
else {
logger('fetch failed: ' . $url);
if ($debug) {
return $x;
}
}
return null;
}

View file

@ -30,7 +30,7 @@ class Ap_probe extends Controller {
}
}
$x = Activity::fetch($resource,$channel);
$x = Activity::fetch($resource,$channel,null,true);
if ($x) {
$o .= '<pre>' . str_replace('\\n',"\n",htmlspecialchars(json_encode($x,JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT))) . '</pre>';