use httpsig auth for getfile

This commit is contained in:
zotlabs
2017-11-29 13:51:54 -08:00
parent 455720ae93
commit 5abcb8c978
2 changed files with 54 additions and 12 deletions

View File

@@ -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']) {