diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2021-03-18 18:34:07 -0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-03-19 11:35:02 +0000 |
commit | c20576cffd0ce98f86929c6c08deca117c8dab1a (patch) | |
tree | 38792fe9cf2ca86330ed5158bfd3107ff560a545 | |
parent | 90ac2a6b2687d4949635cd2001db8bf292f38100 (diff) |
minimum elements for headersbackport/1227/stable20
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r-- | lib/Service/SignatureService.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Service/SignatureService.php b/lib/Service/SignatureService.php index 71855e1a..2b1c94aa 100644 --- a/lib/Service/SignatureService.php +++ b/lib/Service/SignatureService.php @@ -427,10 +427,15 @@ class SignatureService { * * @return string * @throws SocialAppConfigException + * @throws SignatureException */ private function generateEstimatedSignature(string $headers, IRequest $request): string { $keys = explode(' ', $headers); + if (!empty(array_diff(['(request-target)', 'date', 'digest', 'host'], $keys))) { + throw new SignatureException('missing elements in \'headers\''); + } + $target = ''; try { $target = strtolower($request->getMethod()) . " " . $request->getRequestUri(); |