add legacy switch to zot probe requests

This commit is contained in:
Mike Macgirvin 2024-07-06 06:40:57 +10:00
parent a25f4e5f7b
commit 3bdb2d22ae
2 changed files with 5 additions and 5 deletions

View file

@ -2617,10 +2617,10 @@ class Channel
}
public static function keyId($channel)
public static function keyId($channel, $legacy = false)
{
// data validation - if this is wrong, log the call stack so we can find the issue
// data validation - if this is wrong, log the call stack - so we can find the issue
if (! is_array($channel)) {
btlogger('not a channel array: ' . print_r($channel, true));
@ -2632,7 +2632,7 @@ class Channel
$nomadic = PConfig::Get($channel['channel_id'], 'system', 'nomadicAP');
$url = $nomadic ? self::getDidResolver($channel, true) : z_root() . '/channel/' . $channel['channel_address'];
return $url . '#rsakey';
return $url . (($legacy) ? '' : '#rsakey');
}
public static function is_group($uid)

View file

@ -37,7 +37,7 @@ class Zotfinger
'Host' => $m['host'],
'(request-target)' => 'post ' . get_request_string($resource)
];
$h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel), false);
$h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel, true), false);
}
else {
$h = ['Accept: ' . $accepts];
@ -125,7 +125,7 @@ class Zotfinger
'Host' => $m['host'],
'(request-target)' => 'get ' . get_request_string($resource)
];
$h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel), false);
$h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel, true), false);
}
else {
$h = ['Accept: ' . $accepts];