Repository navigation
fix(httpv1): rebuild a message whose body is empty (#1050) - #1054
Merged
Merged
Conversation
Owner
Author
|
Cross-review verdict on
Not breaking. Not checked: chunked and gzip bodies, and the full suite. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make pylint,make mypy,make isort) — not run locallymake testpasses, and a test case covers the change — the touched modules only, not the full suitedocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visibleWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
httpv1.HTTP.from_data(info)raisedTypeError: can't concat NoneType to bytesfor any message with an empty body.readstores an empty body asNone,_make_datapassed it through, andmakeconcatenated it.The fix is in
_make_data: it now passesb''tomakewhen the body isNone.info.bodystaysNonebecausetest_http_runtime.pyandtest_reassembly_end_to_end.pyassert that value, andmakekeeps itsbytessignature. HTTPv2 does not have this bug: DATA, HEADERS, SETTINGS, GOAWAY, CONTINUATION and unassigned frames with empty payloads already round-trip.The new
test_httpv1_from_data_round_trips_a_message_with_an_empty_bodychecks four cases: a request with headers, a headerless request, an empty-bodied response, and a response with a body as a regression guard. Without the fix, the first three fail with theTypeError. The changelog entry pin goes from 166 to the measured 167.Closes #1050