test(http1): add test for when headers contain HTABs
This commit is contained in:
@@ -21,7 +21,7 @@ include = [
|
|||||||
bytes = "0.4.4"
|
bytes = "0.4.4"
|
||||||
futures = "0.1.21"
|
futures = "0.1.21"
|
||||||
futures-cpupool = { version = "0.1.6", optional = true }
|
futures-cpupool = { version = "0.1.6", optional = true }
|
||||||
http = "0.1.7"
|
http = "0.1.13"
|
||||||
httparse = "1.0"
|
httparse = "1.0"
|
||||||
h2 = "0.1.10"
|
h2 = "0.1.10"
|
||||||
iovec = "0.1"
|
iovec = "0.1"
|
||||||
|
|||||||
@@ -1405,6 +1405,19 @@ mod tests {
|
|||||||
assert!(encoder.is_last());
|
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")]
|
#[cfg(feature = "nightly")]
|
||||||
use test::Bencher;
|
use test::Bencher;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user