diff --git a/Cargo.toml b/Cargo.toml index f838dd13..be49f388 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ include = [ bytes = "0.4.4" futures = "0.1.21" futures-cpupool = { version = "0.1.6", optional = true } -http = "0.1.7" +http = "0.1.13" httparse = "1.0" h2 = "0.1.10" iovec = "0.1" diff --git a/src/proto/h1/role.rs b/src/proto/h1/role.rs index 701ec066..78ac0db9 100644 --- a/src/proto/h1/role.rs +++ b/src/proto/h1/role.rs @@ -1405,6 +1405,19 @@ mod tests { assert!(encoder.is_last()); } + #[test] + fn parse_header_htabs() { + let mut bytes = BytesMut::from("HTTP/1.1 200 OK\r\nserver: hello\tworld\r\n\r\n"); + let parsed = Client::parse(&mut bytes, ParseContext { + cached_headers: &mut None, + req_method: &mut Some(Method::GET), + }) + .expect("parse ok") + .expect("parse complete"); + + assert_eq!(parsed.head.headers["server"], "hello\tworld"); + } + #[cfg(feature = "nightly")] use test::Bencher;