aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Magic.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-10-10 13:33:15 +0200
committerMario Vavti <mario@mariovavti.com>2018-10-10 13:33:15 +0200
commitd2e366a46fbdb40c7c6704b3a7f55ad235c93bf3 (patch)
treef815c87d37bdbb7f8a8ee0a7bc2f0074bd8ed1bc /Zotlabs/Module/Magic.php
parentc06b37b798d604a8e5768b8c9b52422b4b34ae36 (diff)
parentc6f3298f7864756f4a9b7827e8490a3ee859f82f (diff)
downloadvolse-hubzilla-d2e366a46fbdb40c7c6704b3a7f55ad235c93bf3.tar.gz
volse-hubzilla-d2e366a46fbdb40c7c6704b3a7f55ad235c93bf3.tar.bz2
volse-hubzilla-d2e366a46fbdb40c7c6704b3a7f55ad235c93bf3.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'Zotlabs/Module/Magic.php')
-rw-r--r--Zotlabs/Module/Magic.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/Zotlabs/Module/Magic.php b/Zotlabs/Module/Magic.php
index be6866592..71737eef8 100644
--- a/Zotlabs/Module/Magic.php
+++ b/Zotlabs/Module/Magic.php
@@ -146,12 +146,17 @@ class Magic extends \Zotlabs\Web\Controller {
$dest = strip_zids($dest);
$dest = strip_query_param($dest,'f');
+ $data = json_encode([ 'OpenWebAuth' => random_string() ]);
+
$headers = [];
$headers['Accept'] = 'application/x-zot+json' ;
$headers['X-Open-Web-Auth'] = random_string();
+ $headers['Host'] = $parsed['host'];
+ $headers['Digest'] = 'SHA-256=' . \Zotlabs\Web\HTTPSig::generate_digest($data,false);
+
$headers = \Zotlabs\Web\HTTPSig::create_sig('',$headers,$channel['channel_prvkey'],
'acct:' . $channel['channel_address'] . '@' . \App::get_hostname(),false,true,'sha512');
- $x = z_fetch_url($basepath . '/owa',false,$redirects,[ 'headers' => $headers ]);
+ $x = z_post_url($basepath . '/owa',$data,$redirects,[ 'headers' => $headers ]);
if($x['success']) {
$j = json_decode($x['body'],true);