mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:15:13 +00:00
provide only one of authorization or signature headers
This commit is contained in:
parent
75148b984f
commit
ce9c4ae520
2 changed files with 4 additions and 11 deletions
|
@ -61,6 +61,7 @@ class HTTPHeaders
|
|||
|
||||
public function getAuthHeader()
|
||||
{
|
||||
logger('getAuthHeader: ' . print_r($_SERVER, true), LOGGER_DATA);
|
||||
$candidates = [
|
||||
'HTTP_AUTHORIZATION',
|
||||
'REDIRECT_HTTP_AUTHORIZATION',
|
||||
|
|
|
@ -582,13 +582,7 @@ class HTTPSig
|
|||
}
|
||||
}
|
||||
|
||||
$authorisation = '';
|
||||
|
||||
if ($auth) {
|
||||
$authorisation = 'Authorization: Signature ' . $headerval;
|
||||
}
|
||||
$sighead = 'Signature: ' . $headerval;
|
||||
|
||||
|
||||
if ($head) {
|
||||
foreach ($head as $k => $v) {
|
||||
// strip the request-target virtual header from the output headers
|
||||
|
@ -598,10 +592,8 @@ class HTTPSig
|
|||
$return_headers[] = $k . ': ' . $v;
|
||||
}
|
||||
}
|
||||
$return_headers[] = $sighead;
|
||||
if ($authorisation) {
|
||||
$return_headers[] = $authorisation;
|
||||
}
|
||||
|
||||
$return_headers[] = (($auth) ? 'Authorization: Signature ' : 'Signature: ') . $headerval;
|
||||
|
||||
return $return_headers;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue