-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix #1828: make enable_compression work on HTTP/1.0 #1910
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1910 +/- ##
==========================================
+ Coverage 97.05% 97.06% +<.01%
==========================================
Files 38 38
Lines 7674 7695 +21
Branches 1339 1346 +7
==========================================
+ Hits 7448 7469 +21
- Misses 102 103 +1
+ Partials 124 123 -1
Continue to review full report at Codecov.
|
Looks like you've committed an syntax error :) |
469bc6a
to
c670c3a
Compare
@asvetlov fixed |
Codecov reports that your change is not fully covered by tests. |
if version >= HttpVersion11: | ||
writer.enable_chunking() | ||
headers[TRANSFER_ENCODING] = 'chunked' | ||
if CONTENT_LENGTH in headers: |
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.
This branch cannot be covered in current version because all the content_length implementations do not return None when there is a Content-Length header. But I think it is necessary in case there are other implementations in the future. We should not rely on the current implementations.
@asvetlov Seems that codecov report is not updating, now it is reported as Among the missing statements and branches, only one statement and one branch is related to this pr. The reason is updated in the above comment. |
@asvetlov any response? |
534c8d8
to
6f490bf
Compare
Please create a PR against master. |
fd3a9e0
to
e1fea8f
Compare
The last tiny change: move a record in |
Ok, I'll update CHANGES in merging. |
What do these changes do?
This pr fix #1828 i.e. generate a correctly compressed response for HTTP/1.0 requests.
Are there changes in behavior for the user?
Call enable_compression on Response class with body set to some bytes now generates a response with content-length instead of chunk-encoded response.
Related issue number
#1828
Checklist
CONTRIBUTORS.txt
CHANGES.rst
#issue_number
format at the end of changelog message. Use Pull Request number if there are no issues for PR or PR covers the issue only partially.