aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Web
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-10-12 04:28:47 +0000
committerMario <mario@mariovavti.com>2018-10-12 10:56:28 +0200
commitf7834547744d232091b966b24b9d2e95bda97681 (patch)
tree79353945d8b1d9dd093def2eee9f0a7d448c78de /Zotlabs/Web
parent2ab6e0843d199df5611072725bcabf76a518f9e9 (diff)
downloadvolse-hubzilla-f7834547744d232091b966b24b9d2e95bda97681.tar.gz
volse-hubzilla-f7834547744d232091b966b24b9d2e95bda97681.tar.bz2
volse-hubzilla-f7834547744d232091b966b24b9d2e95bda97681.zip
verify some edge case http signatures
(cherry picked from commit c6bfd5e7befedf79ab6f7e70902e5fb2aa69fa6f)
Diffstat (limited to 'Zotlabs/Web')
-rw-r--r--Zotlabs/Web/HTTPSig.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php
index ec7bb0d67..f27aa0556 100644
--- a/Zotlabs/Web/HTTPSig.php
+++ b/Zotlabs/Web/HTTPSig.php
@@ -52,6 +52,7 @@ class HTTPSig {
$h = new \Zotlabs\Web\HTTPHeaders($data['header']);
$headers = $h->fetcharr();
$body = $data['body'];
+ $headers['(request-target)'] = $data['request_target'];
}
else {
@@ -60,6 +61,7 @@ class HTTPSig {
strtolower($_SERVER['REQUEST_METHOD']) . ' ' .
$_SERVER['REQUEST_URI'];
$headers['content-type'] = $_SERVER['CONTENT_TYPE'];
+ $headers['content-length'] = $_SERVER['CONTENT_LENGTH'];
foreach($_SERVER as $k => $v) {
if(strpos($k,'HTTP_') === 0) {
@@ -104,10 +106,6 @@ class HTTPSig {
if(strpos($h,'.')) {
$spoofable = true;
}
- if($h === 'host' && (strpos(strtolower(\App::get_hostname()),strtolower($headers[$h])) === false)) {
- logger('bad host: ' . $sig_block['keyId'] . ' != ' . $headers[$h]);
- return $result;
- }
if($h === 'date') {
$d = new \DateTime($headers[$h]);
$d->setTimeZone(new \DateTimeZone('UTC'));