Commit b69ff55
authored
Merge pull request #1 from 3droj7/master (Fix incorrect handling of byte responses (e.g., images) by decoding base64 data)
This PR fixes an issue where binary responses (such as images) were not handled correctly in `python-tls-client-async`. Previously, the response body was treated as plain text, leading to corrupted data when downloading binary content like PNGs or PDFs.
The root cause was that the underlying Go library returns binary responses encoded in base64 if `isByteResponse=true`, but the Python code did not decode this properly.
This patch:
- Modifies `response.py` to split and decode base64-encoded bodies.
- Ensures correct handling of binary responses (e.g., images).
- Sets `"isByteResponse": True` in the session payload for consistency.
Related issues:
- FlorianREGAZ#83
- FlorianREGAZ#119
- FlorianREGAZ#117
- FlorianREGAZ#122
Thanks to @3droj7 for PR.2 files changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
78 | 79 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| 430 | + | |
430 | 431 | | |
431 | 432 | | |
432 | 433 | | |
| |||
0 commit comments