| ... | @@ -1018,9 +1018,11 @@ pub const Request = struct { | ... | @@ -1018,9 +1018,11 @@ pub const Request = struct { |
| 1018 | pub fn write(req: *Request, bytes: []const u8) WriteError!usize { | 1018 | pub fn write(req: *Request, bytes: []const u8) WriteError!usize { |
| 1019 | switch (req.transfer_encoding) { | 1019 | switch (req.transfer_encoding) { |
| 1020 | .chunked => { | 1020 | .chunked => { |
| 1021 | try req.connection.?.writer().print("{x}\r\n", .{bytes.len}); | 1021 | if (bytes.len > 0) { |
| 1022 | try req.connection.?.writer().writeAll(bytes); | 1022 | try req.connection.?.writer().print("{x}\r\n", .{bytes.len}); |
| 1023 | try req.connection.?.writer().writeAll("\r\n"); | 1023 | try req.connection.?.writer().writeAll(bytes); |
| | 1024 | try req.connection.?.writer().writeAll("\r\n"); |
| | 1025 | } |
| 1024 | | 1026 | |
| 1025 | return bytes.len; | 1027 | return bytes.len; |
| 1026 | }, | 1028 | }, |