From 22f88b9f37b7e233fd4f15b73d5a2096224e56dc Mon Sep 17 00:00:00 2001 From: Yusuke Sakurai Date: Tue, 25 Feb 2020 12:49:39 +0900 Subject: fix: [http] Consume unread body and trailers before reading next request (#3990) - Added `ServerRequest.finalize()`: consuming all unread body stream and trailers. - This is cleanup method for reading next request from same keep-alive connection. - Needed when handler didn't consume all body and trailers even after responding. - refactor: `ServerRequest._bodyStream()`, `ServerRequestBody` are removed. - Now using `bodyReader()` and `chunkedBodyReader()` instead. - fix: Trailers should only be read `transfer-encoding` is `chunked` and `trailer` header is set and its value is valid. - fix: use `Headers.append()` on reading trailers. - fix: delete `trailer` field from headers after reading trailers. - reorg: Several functions related to IO are moved into `http/io.ts` --- cli/test_runner.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'cli/test_runner.rs') diff --git a/cli/test_runner.rs b/cli/test_runner.rs index 3d177f60e..b2eea3480 100644 --- a/cli/test_runner.rs +++ b/cli/test_runner.rs @@ -131,6 +131,7 @@ mod tests { let expected: Vec = vec![ format!("{}/cookie_test.ts", root_url), format!("{}/file_server_test.ts", root_url), + format!("{}/io_test.ts", root_url), format!("{}/racing_server_test.ts", root_url), format!("{}/server_test.ts", root_url), ] -- cgit v1.2.3