Skip to content

Commit 537874f

Browse files
committed
Skipping empty chunks of data in ChunkedResponse
1 parent 2e205dc commit 537874f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_httpserver/response.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,8 @@ def _send(self) -> None:
305305
self._send_headers()
306306

307307
for chunk in self._body():
308-
self._send_chunk(chunk)
308+
if 0 < len(chunk): # Don't send empty chunks
309+
self._send_chunk(chunk)
309310

310311
# Empty chunk to indicate end of response
311312
self._send_chunk()

0 commit comments

Comments
 (0)