Captalize header parts

merge-requests/21/head
Bob Mottram 2021-03-14 11:53:13 +00:00
parent 702ca37144
commit 8c2b1e3018
1 changed files with 9 additions and 1 deletions

View File

@ -353,7 +353,15 @@ def verifyPostHeaders(httpPrefix: str, publicKeyPem: str, headers: dict,
signedHeaderList.append(
f'{signedHeader}: {headers[signedHeader]}')
else:
signedHeaderCap = signedHeader.capitalize()
if '-' in signedHeader:
headerParts = signedHeader.split('-')
signedHeaderCap = ''
for part in headerParts:
if signedHeaderCap:
signedHeaderCap += '-'
signedHeaderCap += part.capitalize()
else:
signedHeaderCap = signedHeader.capitalize()
if signedHeaderCap == 'Date':
if not _verifyRecentSignature(headers[signedHeaderCap]):
if debug: