From cd90434ce3080c9c551d21e62653414834924740 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 12 Nov 2019 19:32:23 +0000 Subject: [PATCH] Variations on the theme --- httpsig.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/httpsig.py b/httpsig.py index 2508e11c..654b3d71 100644 --- a/httpsig.py +++ b/httpsig.py @@ -193,14 +193,16 @@ def verifyPostHeaders(httpPrefix: str,publicKeyPem: str,headers: dict, \ if headers.get(signedHeader): signedHeaderList.append(f'content-length: {headers[signedHeader]}') else: - if debug: - print('DEBUG: verifyPostHeaders '+signedHeader+' not found in '+str(headers)) - elif signedHeader == 'Content-Length': - if headers.get(signedHeader): - signedHeaderList.append(f'Content-Length: {headers[signedHeader]}') - else: - if debug: - print('DEBUG: verifyPostHeaders '+signedHeader+' not found in '+str(headers)) + 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'] + signedHeaderList.append(f'content-length: {contentLength}') + else: + if debug: + print('DEBUG: verifyPostHeaders '+signedHeader+' not found in '+str(headers)) else: if headers.get(signedHeader): if signedHeader=='date':