mirror of
https://github.com/friendica/friendica
synced 2025-05-04 09:04:11 +02:00
Remove 'headers' option occurrences and add a warning if used.
This commit is contained in:
parent
c19f1a83ce
commit
a74d88c4ee
4 changed files with 13 additions and 12 deletions
|
@ -411,7 +411,7 @@ class HTTPSignature
|
|||
*/
|
||||
public static function fetchRaw($request, $uid = 0, $binary = false, $opts = [])
|
||||
{
|
||||
$headers = [];
|
||||
$header = [];
|
||||
|
||||
if (!empty($uid)) {
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
|
@ -431,21 +431,21 @@ class HTTPSignature
|
|||
$path = parse_url($request, PHP_URL_PATH);
|
||||
$date = DateTimeFormat::utcNow(DateTimeFormat::HTTP);
|
||||
|
||||
$headers = ['Date: ' . $date, 'Host: ' . $host];
|
||||
$header = ['Date: ' . $date, 'Host: ' . $host];
|
||||
|
||||
$signed_data = "(request-target): get " . $path . "\ndate: ". $date . "\nhost: " . $host;
|
||||
|
||||
$signature = base64_encode(Crypto::rsaSign($signed_data, $owner['uprvkey'], 'sha256'));
|
||||
|
||||
$headers[] = 'Signature: keyId="' . $owner['url'] . '#main-key' . '",algorithm="rsa-sha256",headers="(request-target) date host",signature="' . $signature . '"';
|
||||
$header[] = 'Signature: keyId="' . $owner['url'] . '#main-key' . '",algorithm="rsa-sha256",headers="(request-target) date host",signature="' . $signature . '"';
|
||||
}
|
||||
|
||||
if (!empty($opts['accept_content'])) {
|
||||
$headers[] = 'Accept: ' . $opts['accept_content'];
|
||||
$header[] = 'Accept: ' . $opts['accept_content'];
|
||||
}
|
||||
|
||||
$curl_opts = $opts;
|
||||
$curl_opts['header'] = $headers;
|
||||
$curl_opts['header'] = $header;
|
||||
|
||||
if ($opts['nobody']) {
|
||||
$curlResult = DI::httpRequest()->head($request, $curl_opts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue