From 9533c02280e59acb28029bb0ea78d2aef2f1ceb5 Mon Sep 17 00:00:00 2001 From: Mark Doyle Date: Mon, 12 Jun 2023 13:19:13 +0100 Subject: [PATCH] return correct protocol error when missing http version --- src/handshake/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handshake/client.rs b/src/handshake/client.rs index 66d0d01..08cc7b2 100644 --- a/src/handshake/client.rs +++ b/src/handshake/client.rs @@ -258,7 +258,7 @@ impl TryParse for Response { impl<'h, 'b: 'h> FromHttparse> for Response { fn from_httparse(raw: httparse::Response<'h, 'b>) -> Result { 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)?;