diff options
-rw-r--r-- | Zotlabs/Module/Ap_probe.php | 9 | ||||
-rw-r--r-- | Zotlabs/Web/HTTPHeaders.php | 14 | ||||
-rwxr-xr-x | include/items.php | 1 |
3 files changed, 20 insertions, 4 deletions
diff --git a/Zotlabs/Module/Ap_probe.php b/Zotlabs/Module/Ap_probe.php index 29629a8eb..57e254267 100644 --- a/Zotlabs/Module/Ap_probe.php +++ b/Zotlabs/Module/Ap_probe.php @@ -2,7 +2,7 @@ namespace Zotlabs\Module; require_once('include/zot.php'); - +require_once('addon/pubcrawl/HTTPSig.php'); class Ap_probe extends \Zotlabs\Web\Controller { @@ -21,16 +21,19 @@ class Ap_probe extends \Zotlabs\Web\Controller { $addr = $_GET['addr']; if($_GET['magenv']) { - $headers = 'Accept: application/magic-envelope+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"'; + $headers = 'Accept: application/magic-envelope+json, application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"'; } else { - $headers = 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"'; + $headers = 'Accept: application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"'; } $redirects = 0; $x = z_fetch_url($addr,true,$redirects, [ 'headers' => [ $headers ]]); if($x['success']) $o .= '<pre>' . $x['header'] . '</pre>' . EOL; + + $o .= 'verify returns: ' . \HTTPSig::verify($x) . EOL; + $o .= '<pre>' . str_replace(['\\n','\\'],["\n",''],jindent($x['body'])) . '</pre>'; } return $o; diff --git a/Zotlabs/Web/HTTPHeaders.php b/Zotlabs/Web/HTTPHeaders.php index 1e4c1bf84..4be51a8f3 100644 --- a/Zotlabs/Web/HTTPHeaders.php +++ b/Zotlabs/Web/HTTPHeaders.php @@ -40,6 +40,20 @@ class HTTPHeaders { function fetch() { return $this->parsed; } + + function fetcharr() { + $ret = []; + if($this->parsed) { + foreach($this->parsed as $x) { + foreach($x as $y => $z) { + $ret[$y] = $z; + } + } + } + return $ret; + } + + } diff --git a/include/items.php b/include/items.php index 5a0ca01c6..e7bec7f20 100755 --- a/include/items.php +++ b/include/items.php @@ -1600,7 +1600,6 @@ function item_store($arr, $allow_exec = false, $deliver = true) { $arr['aid'] = ((x($arr,'aid')) ? intval($arr['aid']) : 0); $arr['mid'] = ((x($arr,'mid')) ? notags(trim($arr['mid'])) : random_string()); $arr['revision'] = ((x($arr,'revision') && intval($arr['revision']) > 0) ? intval($arr['revision']) : 0); -logger('revision: ' . $arr['revision']); $arr['author_xchan'] = ((x($arr,'author_xchan')) ? notags(trim($arr['author_xchan'])) : ''); $arr['owner_xchan'] = ((x($arr,'owner_xchan')) ? notags(trim($arr['owner_xchan'])) : ''); |