Replies: 2 comments 1 reply
-
I think I know what's going on there, tho could you demonstrate an example against a public URL to help us talk this through? |
Beta Was this translation helpful? Give feedback.
0 replies
-
An example on Archlinux:
# test.py
import httpx
url = 'https://ip.011102.xyz/'
response = httpx.get(url, headers={'accept-encoding': 'zstd'})
print(response.headers.get('content-encoding'))
print(response.text) If change If delete following lines in _decoders.py if brotli is None:
SUPPORTED_DECODERS.pop("br") # pragma: no cover
if zstd is None:
SUPPORTED_DECODERS.pop("zstd") # pragma: no cover It will report the error as expected. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I strongly not recommend to continue using the current decoding strategy for Brotli & Zstandard.
According to my attempts, when the response compression method is br,
response.text
is displayed as garbled. At first I thought it was a problem of text encoding, which wasted a lot of time.According to
httpx/_decoders.py
, I found that there are errors when the decoder initializes. But because of pop, nothing is done.Beta Was this translation helpful? Give feedback.
All reactions