| ... | @@ -693,9 +693,11 @@ pub const Response = struct { | ... | @@ -693,9 +693,11 @@ pub const Response = struct { |
| 693 | | 693 | |
| 694 | switch (res.transfer_encoding) { | 694 | switch (res.transfer_encoding) { |
| 695 | .chunked => { | 695 | .chunked => { |
| 696 | try res.connection.writer().print("{x}\r\n", .{bytes.len}); | 696 | if (bytes.len > 0) { |
| 697 | try res.connection.writeAll(bytes); | 697 | try res.connection.writer().print("{x}\r\n", .{bytes.len}); |
| 698 | try res.connection.writeAll("\r\n"); | 698 | try res.connection.writeAll(bytes); |
| | 699 | try res.connection.writeAll("\r\n"); |
| | 700 | } |
| 699 | | 701 | |
| 700 | return bytes.len; | 702 | return bytes.len; |
| 701 | }, | 703 | }, |