Skip to content

bug, different response content #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
michaelx1993 opened this issue Apr 21, 2024 · 3 comments
Open

bug, different response content #119

michaelx1993 opened this issue Apr 21, 2024 · 3 comments

Comments

@michaelx1993
Copy link

https://sf16-sg.tiktokcdn.com/obj/eden-sg/uvkuhyieh7lpqpbj/pwa/192x192-1.png

if you request to this image url with requqests and tls_client.Session() , you will get different response.

and the png response from tls-client doesn't work.

@ghost
Copy link

ghost commented May 10, 2024

same

@taoshiyu
Copy link

request image resource use requests

   import requests

@enodr
Copy link

enodr commented Jun 12, 2024

This pull request fixes the problem:
#116

@ghost ghost mentioned this issue Dec 4, 2024
diprog added a commit to diprog/python-tls-client-async that referenced this issue May 12, 2025
…yte 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants