From 98931a8623934a3e4b4bac692119659f581e6f83 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sat, 20 Jan 2018 16:51:18 -0800 Subject: [PATCH] test case for broken transfer encoding --- src/server/h1.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/server/h1.rs b/src/server/h1.rs index a6affe4cc..b6629a1f5 100644 --- a/src/server/h1.rs +++ b/src/server/h1.rs @@ -1201,6 +1201,18 @@ mod tests { } else { panic!("Error"); } + + // type in chunked + let mut buf = Buffer::new( + "GET /test HTTP/1.1\r\n\ + transfer-encoding: chnked\r\n\r\n"); + let req = parse_ready!(&mut buf); + + if let Ok(val) = req.chunked() { + assert!(!val); + } else { + panic!("Error"); + } } #[test]