Added support for Accept-Encoding

Signed-off-by: Alexandru Cihodaru <cihodar@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
This commit is contained in:
Alexandru Cihodaru
2020-09-03 18:23:24 +03:00
committed by Adrian Catangiu
parent 8a8d7bb5b1
commit 683b85d07e
5 changed files with 157 additions and 8 deletions

View File

@@ -510,5 +510,15 @@ mod tests {
assert_eq!(request.headers.expect(), false);
assert_eq!(request.headers.content_length(), 0);
assert!(request.body.is_none());
let request = Request::try_from(b"GET http://localhost/ HTTP/1.0\r\n\
Accept-Encoding: identity;q=0\r\n\r\n");
assert_eq!(
request.unwrap_err(),
RequestError::HeaderError(HttpHeaderError::InvalidValue(
"Accept-Encoding".to_string(),
"identity;q=0".to_string()
))
);
}
}