aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-29 13:51:54 -0800
committerzotlabs <mike@macgirvin.com>2017-11-29 13:51:54 -0800
commit5abcb8c97813d66b63ca697ca626347a9fd8d95c (patch)
tree0bc8c7011de18a7f83eb777ca2e9a1c923717fb4 /include
parent455720ae938126d9a0d3c728beb0a7ba3268a4d0 (diff)
downloadvolse-hubzilla-5abcb8c97813d66b63ca697ca626347a9fd8d95c.tar.gz
volse-hubzilla-5abcb8c97813d66b63ca697ca626347a9fd8d95c.tar.bz2
volse-hubzilla-5abcb8c97813d66b63ca697ca626347a9fd8d95c.zip
use httpsig auth for getfile
Diffstat (limited to 'include')
-rw-r--r--include/import.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/import.php b/include/import.php
index 702fa7e54..8cab16342 100644
--- a/include/import.php
+++ b/include/import.php
@@ -1199,7 +1199,14 @@ function sync_files($channel, $files) {
continue;
}
$redirects = 0;
- $x = z_post_url($fetch_url,$parr,$redirects,array('filep' => $fp));
+
+
+ $headers = [];
+ $headers['Accept'] = 'application/x-zot+json' ;
+ $headers['Sigtoken'] = random_string();
+ $headers = \Zotlabs\Web\HTTPSig::create_sig('',$headers,$channel['channel_prvkey'], 'acct:' . $channel['channel_address'] . '@' . \App::get_hostname(),false,true,'sha512');
+
+ $x = z_post_url($fetch_url,$parr,$redirects,[ 'filep' => $fp, 'headers' => $headers]);
fclose($fp);
if($x['success']) {