forked from indymedia/epicyon
Separate cases
parent
f2b295ed7b
commit
808b5a4c8b
14
httpsig.py
14
httpsig.py
|
@ -191,7 +191,7 @@ def verifyPostHeaders(httpPrefix: str,publicKeyPem: str,headers: dict, \
|
|||
signedHeaderList.append(f'digest: SHA-256={bodyDigest}')
|
||||
#print('***************************Verify digest: SHA-256='+bodyDigest)
|
||||
#print('***************************Verify messageBodyJsonStr: '+messageBodyJsonStr)
|
||||
elif signedHeader == 'content-length' or signedHeader == 'Content-Length':
|
||||
elif signedHeader == 'content-length':
|
||||
if headers.get(signedHeader):
|
||||
if int(headers[signedHeader])!=contentLength:
|
||||
if debug:
|
||||
|
@ -203,6 +203,18 @@ def verifyPostHeaders(httpPrefix: str,publicKeyPem: str,headers: dict, \
|
|||
else:
|
||||
if debug:
|
||||
print('DEBUG: verifyPostHeaders '+signedHeader+' not found in '+str(headers))
|
||||
elif signedHeader == 'Content-Length':
|
||||
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 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':
|
||||
|
|
Loading…
Reference in New Issue