More debug

merge-requests/3/head
Bob Mottram 2019-11-12 17:16:34 +00:00
parent a3e7b0ed53
commit 73ebebdcd1
1 changed files with 10 additions and 4 deletions

View File

@ -191,11 +191,17 @@ def verifyPostHeaders(httpPrefix: str,publicKeyPem: str,headers: dict, \
#print('***************************Verify digest: SHA-256='+bodyDigest)
#print('***************************Verify messageBodyJsonStr: '+messageBodyJsonStr)
elif signedHeader == 'content-length' or signedHeader == 'Content-Length':
if int(headers[signedHeader])!=contentLength:
if headers.get(signedHeader):
if int(headers[signedHeader])!=contentLength:
if debug:
print('DEBUG: verifyPostHeaders content-length does not match '+headers[signedHeader]+' != '+str(contentLength))
return False
if debug:
print('DEBUG: verifyPostHeaders content-length does not match '+headers[signedHeader]+' != '+str(contentLength))
return False
signedHeaderList.append(f'content-length: {headers[signedHeader]}')
print('DEBUG: verifyPostHeaders adding content-length to signedHeaderList')
signedHeaderList.append(f'content-length: {headers[signedHeader]}')
else:
if debug:
print('DEBUG: verifyPostHeaders '+signedHeader+' not found in '+str(headers))
else:
if headers.get(signedHeader):
if signedHeader=='date':