diff options
Diffstat (limited to 'http/server.ts')
| -rw-r--r-- | http/server.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/http/server.ts b/http/server.ts index 0892b26f7..484ecf808 100644 --- a/http/server.ts +++ b/http/server.ts @@ -1,5 +1,5 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -const { listen, toAsyncIterator, copy } = Deno; +const { listen, copy, toAsyncIterator } = Deno; type Conn = Deno.Conn; type Reader = Deno.Reader; type Writer = Deno.Writer; @@ -79,6 +79,7 @@ async function writeChunkedBody(w: Writer, r: Reader): Promise<void> { const encoder = new TextEncoder(); for await (const chunk of toAsyncIterator(r)) { + if (chunk.byteLength <= 0) continue; const start = encoder.encode(`${chunk.byteLength.toString(16)}\r\n`); const end = encoder.encode("\r\n"); await writer.write(start); |
