Manually reset the buffer when streaming request body (#2183)

This commit is contained in:
Adam Hopkins 2021-07-06 08:24:20 +03:00 committed by Adam Hopkins
parent c3bca97ee1
commit df8abe9cfd
No known key found for this signature in database
GPG Key ID: 6A33C08203F67A28

View File

@ -490,6 +490,9 @@ class Http:
if size <= 0:
self.request_body = None
# Because we are leaving one CRLF in the buffer, we manually
# reset the buffer here
self.recv_buffer = bytearray()
if size < 0:
self.keep_alive = False