diff options
author | zotlabs <mike@macgirvin.com> | 2017-07-18 21:16:18 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-07-18 21:16:18 -0700 |
commit | 6103c301848105a3bca3de81e9982276b2c38d76 (patch) | |
tree | 9b068dd2a9d16b7759a593dc66e71414c33b64f8 /Zotlabs/Module | |
parent | b52a968c7461c9873d20d40887f470ab255f16f2 (diff) | |
download | volse-hubzilla-6103c301848105a3bca3de81e9982276b2c38d76.tar.gz volse-hubzilla-6103c301848105a3bca3de81e9982276b2c38d76.tar.bz2 volse-hubzilla-6103c301848105a3bca3de81e9982276b2c38d76.zip |
provide optional salmon signatures for AP entities
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Ap_probe.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Zotlabs/Module/Ap_probe.php b/Zotlabs/Module/Ap_probe.php index 4649914d5..f788fa73a 100644 --- a/Zotlabs/Module/Ap_probe.php +++ b/Zotlabs/Module/Ap_probe.php @@ -11,7 +11,8 @@ class Ap_probe extends \Zotlabs\Web\Controller { $o .= '<h3>ActivityPub Probe Diagnostic</h3>'; $o .= '<form action="ap_probe" method="get">'; - $o .= 'Lookup URI: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />'; + $o .= 'Lookup URI: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" /><br>'; + $o .= 'Request Signed version: <input type=checkbox name="magenv" value="1" ><br>'; $o .= '<input type="submit" name="submit" value="Submit" /></form>'; $o .= '<br /><br />'; @@ -19,11 +20,15 @@ class Ap_probe extends \Zotlabs\Web\Controller { if(x($_GET,'addr')) { $addr = $_GET['addr']; - $redirects = 0; - $x = z_fetch_url($addr,true,$redirects, - [ 'headers' => [ 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"']]); -logger('fetch: ' . print_r($x,true)); + if($_GET['magenv']) { + $headers = 'Accept: application/magic-envelope+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"'; + } + else { + $headers = 'Accept: 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>' . str_replace('\\','',jindent($x['body'])) . '</pre>'; } |