more work on activitypub httpsignature verification
This commit is contained in:
parent
68f6043d44
commit
e9679d251c
@ -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 {
|
||||
|
||||
@ -31,6 +31,9 @@ class Ap_probe extends \Zotlabs\Web\Controller {
|
||||
$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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user