fix(server): coerce responses with HTTP2 version to HTTP/1.1 when protocol is 1.x

This commit is contained in:
Sean McArthur
2018-08-10 13:07:52 -07:00
parent 853266d873
commit 195fbb2a37
2 changed files with 32 additions and 0 deletions

View File

@@ -267,6 +267,10 @@ impl Http1Transaction for Server {
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 => {
warn!("response with HTTP2 version coerced to HTTP/1.1");
extend(dst, b"HTTP/1.1 ");
},
_ => unreachable!(),
}