From d04d047b6414e9aa74ac73060453e8263fff156b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 1 Sep 2021 15:22:11 +0100 Subject: [PATCH] Tidying --- httpsig.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/httpsig.py b/httpsig.py index ad9b92632..b3651707e 100644 --- a/httpsig.py +++ b/httpsig.py @@ -338,19 +338,17 @@ def verifyPostHeaders(httpPrefix: str, publicKeyPem: str, headers: dict, if headers.get(signedHeader): appendStr = f'content-length: {headers[signedHeader]}' signedHeaderList.append(appendStr) + elif headers.get('Content-Length'): + contentLength = headers['Content-Length'] + signedHeaderList.append(f'content-length: {contentLength}') + elif headers.get('Content-length'): + contentLength = headers['Content-length'] + appendStr = f'content-length: {contentLength}' + signedHeaderList.append(appendStr) else: - if headers.get('Content-Length'): - contentLength = headers['Content-Length'] - signedHeaderList.append(f'content-length: {contentLength}') - else: - if headers.get('Content-length'): - contentLength = headers['Content-length'] - appendStr = f'content-length: {contentLength}' - signedHeaderList.append(appendStr) - else: - if debug: - print('DEBUG: verifyPostHeaders ' + signedHeader + - ' not found in ' + str(headers)) + if debug: + print('DEBUG: verifyPostHeaders ' + signedHeader + + ' not found in ' + str(headers)) else: if headers.get(signedHeader): if signedHeader == 'date' and not noRecencyCheck: