Non-binary encoding for header list

master
Bob Mottram 2019-08-16 09:57:47 +01:00
parent 83698f5c2c
commit e86a01a9c4
1 changed files with 1 additions and 1 deletions

View File

@ -121,7 +121,7 @@ def verifyPostHeaders(httpPrefix: str,publicKeyPem: str,headers: dict, \
f'(request-target): {method.lower()} {path}') f'(request-target): {method.lower()} {path}')
elif signedHeader == 'digest': elif signedHeader == 'digest':
bodyDigest = \ bodyDigest = \
base64.b64encode(SHA256.new(messageBodyJsonStr.encode()).digest()) base64.b64encode(SHA256.new(messageBodyJsonStr.encode()).digest()).encode('utf-8')
signedHeaderList.append(f'digest: SHA-256={bodyDigest}') signedHeaderList.append(f'digest: SHA-256={bodyDigest}')
else: else:
if headers.get(signedHeader): if headers.get(signedHeader):