-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Remove unreachable content length check for chunked encoding #10058
Conversation
_prepare_headers had a check to remove content-length if chunked encoding was set. This code was unreachable under normal circumstances because enabling chunked encoding checks to see if the content-length header is there and raises RuntimeError. It was still possible to reach this code if RuntimeError was suppressed because enable_chunked_encoding set self._chunked = True before checking if it needed to raise. To make it truely unreachable, the check is now done first in enable_chunked_encoding
CodSpeed Performance ReportMerging #10058 will not alter performanceComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #10058 +/- ##
=======================================
Coverage 98.75% 98.75%
=======================================
Files 121 121
Lines 36789 36787 -2
Branches 4395 4394 -1
=======================================
Hits 36330 36330
+ Misses 312 311 -1
+ Partials 147 146 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Backport to 3.11: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 12372d7 on top of patchback/backports/3.11/12372d7fe06d95c1c633a3b8119aecf4e86cf94d/pr-10058 Backporting merged PR #10058 into master
🤖 @patchback |
Backport to 3.12: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 12372d7 on top of patchback/backports/3.12/12372d7fe06d95c1c633a3b8119aecf4e86cf94d/pr-10058 Backporting merged PR #10058 into master
🤖 @patchback |
(cherry picked from commit 12372d7)
(cherry picked from commit 12372d7)
…check for chunked encoding (#10060)
…check for chunked encoding (#10061)
_prepare_headers
had a check to remove content-length if chunked encoding was set. This code was unreachable under normal circumstances because enabling chunked encoding checks to see if the content-length header is there and raisesRuntimeError
. It was still possible to reach this code ifRuntimeError
was suppressed becauseenable_chunked_encoding
setself._chunked = True
before checking if it needed to raise. To make it truly unreachable, the check is now done first inenable_chunked_encoding