You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
httpv1: from_data fails on a message with an empty body #1050
HTTPv1 cannot rebuild a message whose body is empty. Measured on main (487306631) and on #1049's head:
raw = b'GET / HTTP/1.1\r\nHost: a\r\n\r\n'
HTTP.from_data(HTTP(io.BytesIO(raw), len(raw)).info)
-> TypeError: can't concat NoneType to bytes (httpv1.py:320 on #1049, :312 on main)
Cause:read stores body=... or None (httpv1.py:237 on #1049). _make_data passes that through (:355), so make, which declares body: bytes = b'', receives an explicit None and concatenates it. Responses with a non-empty body round-trip fine.
Fix: make make (or _make_data) treat body=None as b''. Add a from_data round-trip test for an empty-bodied request with headers, a headerless request, and an empty-bodied response.
Blocked on #1049, which edits httpv1.py. Work starts once #1049 merges or closes. Found while reviewing #1049.
Activity
JarryShaw commentedon Oct 5, 2026
Unblocked: #1049 merged. A worker is on the fix now.
fix(httpv1): rebuild a message whose body is empty (#1050) (#1054)