| ... | @@ -534,9 +534,14 @@ pub const Request = struct { | ... | @@ -534,9 +534,14 @@ pub const Request = struct { |
| 534 | const r = &request.server.reader; | 534 | const r = &request.server.reader; |
| 535 | if (keep_alive and request.head.keep_alive) switch (r.state) { | 535 | if (keep_alive and request.head.keep_alive) switch (r.state) { |
| 536 | .received_head => { | 536 | .received_head => { |
| 537 | const reader_interface = request.reader() catch return false; | 537 | if (request.head.method.requestHasBody()) { |
| 538 | _ = reader_interface.discardRemaining() catch return false; | 538 | assert(request.head.transfer_encoding != .none or request.head.content_length != null); |
| 539 | assert(r.state == .ready); | 539 | const reader_interface = request.reader() catch return false; |
| | 540 | _ = reader_interface.discardRemaining() catch return false; |
| | 541 | assert(r.state == .ready); |
| | 542 | } else { |
| | 543 | r.state = .ready; |
| | 544 | } |
| 540 | return true; | 545 | return true; |
| 541 | }, | 546 | }, |
| 542 | .body_remaining_content_length, .body_remaining_chunk_len, .body_none, .ready => return true, | 547 | .body_remaining_content_length, .body_remaining_chunk_len, .body_none, .ready => return true, |