Skip to content

Commit d26a1cd

Browse files
Merge pull request #38 from Mastercard/feature/jwe-empty-response
Handle JWE empty response
2 parents 7e2eaa0 + ae3a823 commit d26a1cd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

client_encryption/api_encryption.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ def encrypt_jwe_payload(conf, body):
107107
@staticmethod
108108
def decrypt_jwe_payload(conf, body):
109109
decrypted_body = decrypt_jwe(body, conf)
110-
payload = json.dumps(decrypted_body).encode('utf-8')
110+
try:
111+
payload = json.dumps(decrypted_body).encode('utf-8')
112+
except:
113+
payload = decrypted_body
111114

112115
return payload
113116

client_encryption/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
__version__ = "1.21.0"
3+
__version__ = "1.21.1"

0 commit comments

Comments
 (0)