-
Notifications
You must be signed in to change notification settings - Fork 64
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
Gzip request body if server support it #1476
Conversation
Codecov ReportAttention:
... and 112 files with indirect coverage changes 📢 Thoughts on this report? Let us know!. |
def send(self, request, stream=False, **kw): | ||
if request.body is not None and not stream: | ||
request_body = request.body if isinstance(request.body, bytes) else bytes(request.body, "utf-8") | ||
gzip_compress = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, zlib.MAX_WBITS | 16) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we try catch that wrt. to https://docs.python.org/3/library/zlib.html#zlib.error
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary because an exception is very generic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They mentioned that this could happen on compression as well
05c38a8
to
5a81fd1
Compare
This reverts commit 462afe5.
Co-authored-by: BartoszPrusak <[email protected]>
This reverts commit 799e9d8.
This reverts commit 6eeaf34.
Co-authored-by: BartoszPrusak <[email protected]>
Before submitting checklist