Skip to content

Commit 7e2eaa0

Browse files
authored
Merge pull request #36 from Mastercard/feature/handle-empty-response
Handle use case where response body is empty
2 parents 599cc68 + ae18be5 commit 7e2eaa0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

client_encryption/api_encryption.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ def decrypt_field_level_payload(headers, conf, body):
133133
return body
134134

135135
decrypted_body = decrypt_field_level(body, conf, params)
136-
payload = json.dumps(decrypted_body).encode('utf-8')
136+
try:
137+
payload = json.dumps(decrypted_body).encode('utf-8')
138+
except:
139+
payload = decrypted_body
137140

138141
return payload
139142

client_encryption/version.py

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

0 commit comments

Comments
 (0)