mirror of
https://github.com/friendica/friendica
synced 2024-12-23 16:00:16 +00:00
Don't let the tests fail. The test user doesn't have a private key
This commit is contained in:
parent
7b13b7e9c8
commit
ecd2d88b09
1 changed files with 12 additions and 10 deletions
|
@ -413,12 +413,15 @@ class HTTPSignature
|
|||
*/
|
||||
public static function fetchRaw($request, $uid = 0, $binary = false, $opts = [])
|
||||
{
|
||||
$headers = [];
|
||||
|
||||
if (!empty($uid)) {
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
if (!$owner) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!empty($owner['uprvkey'])) {
|
||||
// Header data that is about to be signed.
|
||||
$host = parse_url($request, PHP_URL_HOST);
|
||||
$path = parse_url($request, PHP_URL_PATH);
|
||||
|
@ -431,8 +434,7 @@ class HTTPSignature
|
|||
$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 . '"';
|
||||
} else {
|
||||
$headers = [];
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($opts['accept_content'])) {
|
||||
|
|
Loading…
Reference in a new issue