aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Cdav.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Cdav.php')
-rw-r--r--Zotlabs/Module/Cdav.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/Zotlabs/Module/Cdav.php b/Zotlabs/Module/Cdav.php
index bae3fc6aa..abaec26a6 100644
--- a/Zotlabs/Module/Cdav.php
+++ b/Zotlabs/Module/Cdav.php
@@ -32,6 +32,11 @@ class Cdav extends \Zotlabs\Web\Controller {
/* Signature authentication */
if(array_key_exists($head,$_SERVER) && substr(trim($_SERVER[$head]),0,9) === 'Signature') {
+ if($head !== 'HTTP_AUTHORIZATION') {
+ $_SERVER['HTTP_AUTHORIZATION'] = $_SERVER[$head];
+ continue;
+ }
+
$sigblock = \Zotlabs\Web\HTTPSig::parse_sigheader($_SERVER[$head]);
if($sigblock) {
$keyId = $sigblock['keyId'];
@@ -43,20 +48,17 @@ class Cdav extends \Zotlabs\Web\Controller {
$c = channelx_by_hash($r[0]['hubloc_hash']);
if($c) {
$a = q("select * from account where account_id = %d limit 1",
- intval($c[0]['channel_account_id'])
+ intval($c['channel_account_id'])
);
if($a) {
- $record = [ 'channel' => $c[0], 'account' => $a[0] ];
- $channel_login = $c[0]['channel_id'];
+ $record = [ 'channel' => $c, 'account' => $a[0] ];
+ $channel_login = $c['channel_id'];
}
}
}
if(! $record)
continue;
- if($head !== 'HTTP_AUTHORIZATION') {
- $_SERVER['HTTP_AUTHORIZATION'] = $_SERVER[$head];
- }
if($record) {
$verified = \Zotlabs\Web\HTTPSig::verify('',$record['channel']['channel_pubkey']);
if(! ($verified && $verified['header_signed'] && $verified['header_valid'])) {