mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:55:19 +00:00
discovery issue
This commit is contained in:
parent
48fef42b5a
commit
87cb92b2bf
1 changed files with 14 additions and 12 deletions
|
@ -639,14 +639,15 @@ function discover_resource(string $resource, $protocol = '', $verify = true)
|
||||||
|
|
||||||
// Check the HTTP signature
|
// Check the HTTP signature
|
||||||
|
|
||||||
|
$hsig_valid = true;
|
||||||
if ($verify) {
|
if ($verify) {
|
||||||
$hsig = $record['signature'];
|
$hsig = $record['signature'];
|
||||||
$hsig_valid = (bool) ($hsig && $hsig['signer'] === $link['href'] && $hsig['header_valid'] && $hsig['content_valid']);
|
$hsig_valid = (bool)($hsig && $hsig['signer'] === $link['href'] && $hsig['header_valid'] && $hsig['content_valid']);
|
||||||
if($hsig_valid) {
|
}
|
||||||
$nomad = Libzot::import_xchan($record['data']);
|
if ($hsig_valid) {
|
||||||
if ($nomad['success']) {
|
$nomad = Libzot::import_xchan($record['data']);
|
||||||
return $nomad['hash'];
|
if ($nomad['success']) {
|
||||||
}
|
return $nomad['hash'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -661,14 +662,15 @@ function discover_resource(string $resource, $protocol = '', $verify = true)
|
||||||
|
|
||||||
// Check the HTTP signature
|
// Check the HTTP signature
|
||||||
|
|
||||||
|
$hsig_valid = true;
|
||||||
if ($verify) {
|
if ($verify) {
|
||||||
$hsig = $record['signature'];
|
$hsig = $record['signature'];
|
||||||
$hsig_valid = (bool) ($hsig && $hsig['signer'] === $link['href'] && $hsig['header_valid'] && $hsig['content_valid']);
|
$hsig_valid = (bool)($hsig && $hsig['signer'] === $link['href'] && $hsig['header_valid'] && $hsig['content_valid']);
|
||||||
if($hsig_valid) {
|
}
|
||||||
$zot6 = Libzot::import_xchan($record['data']);
|
if ($hsig_valid) {
|
||||||
if ($zot6['success']) {
|
$zot6 = Libzot::import_xchan($record['data']);
|
||||||
return $zot6['hash'];
|
if ($zot6['success']) {
|
||||||
}
|
return $zot6['hash'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue