feat(server): add http1_only configuration

A new configuration http1_only to Builder and Connection are added, which indicates that the upgrading to h2 does not perform when a parsing error occurs.

Fixes #1512.
This commit is contained in:
Yusuke Sasaki
2018-06-05 01:57:19 +09:00
committed by Sean McArthur
parent 785914e77e
commit 14d9246de2
2 changed files with 58 additions and 18 deletions

View File

@@ -167,6 +167,14 @@ impl<I> Builder<I> {
}
}
/// Sets whether HTTP/1 is required.
///
/// Default is `false`.
pub fn http1_only(mut self, val: bool) -> Self {
self.protocol.http1_only(val);
self
}
/// Sets whether HTTP/2 is required.
///
/// Default is `false`.