Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 24 additions & 18 deletions src/proto/h1/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,15 +405,18 @@ impl Http1Transaction for Server {
{
extend(dst, b"HTTP/1.1 200 OK\r\n");
} else {
match msg.head.version {
Version::HTTP_10 => extend(dst, b"HTTP/1.0 "),
Version::HTTP_11 => extend(dst, b"HTTP/1.1 "),
Version::HTTP_2 => {
debug!("response with HTTP2 version coerced to HTTP/1.1");
extend(dst, b"HTTP/1.1 ");
}
other => panic!("unexpected response version: {:?}", other),
}
extend(
dst,
match msg.head.version {
Version::HTTP_10 => b"HTTP/1.0 ",
Version::HTTP_11 => b"HTTP/1.1 ",
Version::HTTP_2 => {
debug!("response with HTTP2 version coerced to HTTP/1.1");
b"HTTP/1.1 "
}
other => panic!("unexpected response version: {:?}", other),
},
);

extend(dst, msg.head.subject.as_str().as_bytes());
extend(dst, b" ");
Expand Down Expand Up @@ -1186,15 +1189,18 @@ impl Http1Transaction for Client {
//TODO: add API to http::Uri to encode without std::fmt
let _ = write!(FastWrite(dst), "{} ", msg.head.subject.1);

match msg.head.version {
Version::HTTP_10 => extend(dst, b"HTTP/1.0"),
Version::HTTP_11 => extend(dst, b"HTTP/1.1"),
Version::HTTP_2 => {
debug!("request with HTTP2 version coerced to HTTP/1.1");
extend(dst, b"HTTP/1.1");
}
other => panic!("unexpected request version: {:?}", other),
}
extend(
dst,
match msg.head.version {
Version::HTTP_10 => b"HTTP/1.0",
Version::HTTP_11 => b"HTTP/1.1",
Version::HTTP_2 => {
debug!("request with HTTP2 version coerced to HTTP/1.1");
b"HTTP/1.1"
}
other => panic!("unexpected request version: {:?}", other),
},
);
extend(dst, b"\r\n");

if let Some(orig_headers) = msg.head.extensions.get::<HeaderCaseMap>() {
Expand Down
Loading