feat(server): support HTTP1 and HTTP2 automatically
If an HTTP/1 connection has a parse error, but it starts with the HTTP2 preface, converts the connection automatically into an HTTP2 server connection. Closes #1486
This commit is contained in:
@@ -186,14 +186,14 @@ where
|
||||
use ::error::{Kind, Parse};
|
||||
let status = match *err.kind() {
|
||||
Kind::Parse(Parse::Method) |
|
||||
Kind::Parse(Parse::Version) |
|
||||
Kind::Parse(Parse::Header) |
|
||||
Kind::Parse(Parse::Uri) => {
|
||||
Kind::Parse(Parse::Uri) |
|
||||
Kind::Parse(Parse::Version) => {
|
||||
StatusCode::BAD_REQUEST
|
||||
},
|
||||
Kind::Parse(Parse::TooLarge) => {
|
||||
StatusCode::REQUEST_HEADER_FIELDS_TOO_LARGE
|
||||
}
|
||||
},
|
||||
_ => return None,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user