return correct protocol error when missing http version

This commit is contained in:
Mark Doyle 2023-06-12 13:19:13 +01:00
parent d7b559d724
commit 9533c02280
1 changed files with 1 additions and 1 deletions

View File

@ -258,7 +258,7 @@ impl TryParse for Response {
impl<'h, 'b: 'h> FromHttparse<httparse::Response<'h, 'b>> for Response {
fn from_httparse(raw: httparse::Response<'h, 'b>) -> Result<Self> {
if raw.version.expect("Bug: no HTTP version") < /*1.*/1 {
return Err(Error::Protocol(ProtocolError::WrongHttpMethod));
return Err(Error::Protocol(ProtocolError::WrongHttpVersion));
}
let headers = HeaderMap::from_httparse(raw.headers)?;