aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Web/HTTPSig.php
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2018-04-16 17:27:14 +0200
committerGitHub <noreply@github.com>2018-04-16 17:27:14 +0200
commit283e5d3a5c9557195a640de5f0acefc884e904bb (patch)
tree86d32da9fc05d15491f4ccf04b27ea223307f323 /Zotlabs/Web/HTTPSig.php
parent99dc1614836df2b69ee40382fc4b73546a847a60 (diff)
parentbef5be827d15bc54c9b88bc10313b28172069fef (diff)
downloadvolse-hubzilla-283e5d3a5c9557195a640de5f0acefc884e904bb.tar.gz
volse-hubzilla-283e5d3a5c9557195a640de5f0acefc884e904bb.tar.bz2
volse-hubzilla-283e5d3a5c9557195a640de5f0acefc884e904bb.zip
Merge pull request #8 from redmatrix/dev
Dev
Diffstat (limited to 'Zotlabs/Web/HTTPSig.php')
-rw-r--r--Zotlabs/Web/HTTPSig.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php
index 9bcc2e5ec..255511ede 100644
--- a/Zotlabs/Web/HTTPSig.php
+++ b/Zotlabs/Web/HTTPSig.php
@@ -59,6 +59,8 @@ class HTTPSig {
$headers['(request-target)'] =
strtolower($_SERVER['REQUEST_METHOD']) . ' ' .
$_SERVER['REQUEST_URI'];
+ $headers['content-type'] = $_SERVER['CONTENT_TYPE'];
+
foreach($_SERVER as $k => $v) {
if(strpos($k,'HTTP_') === 0) {
$field = str_replace('_','-',strtolower(substr($k,5)));
@@ -67,6 +69,10 @@ class HTTPSig {
}
}
+ // logger('SERVER: ' . print_r($_SERVER,true), LOGGER_ALL);
+
+ // logger('headers: ' . print_r($headers,true), LOGGER_ALL);
+
$sig_block = null;
if(array_key_exists('signature',$headers)) {
@@ -194,10 +200,10 @@ class HTTPSig {
if($r) {
$j = json_decode($r,true);
- if($j['id'] !== $id)
- return false;
-
if(array_key_exists('publicKey',$j) && array_key_exists('publicKeyPem',$j['publicKey'])) {
+ if((array_key_exists('id',$j['publicKey']) && $j['publicKey']['id'] !== $id) && $j['id'] !== $id)
+ return false;
+
return($j['publicKey']['publicKeyPem']);
}
}