add option to disable http2 upgrade (#1292)

Co-authored-by: Sean McArthur <sean@seanmonstar.com>
This commit is contained in:
Mohamed Daahir
2021-06-25 04:00:06 +03:00
committed by GitHub
parent d9308f1b26
commit bccefe7486
2 changed files with 46 additions and 13 deletions

View File

@@ -404,6 +404,11 @@ impl ClientBuilder {
self.with_inner(|inner| inner.http1_title_case_headers())
}
/// Only use HTTP/1.
pub fn http1_only(self) -> ClientBuilder {
self.with_inner(|inner| inner.http1_only())
}
/// Only use HTTP/2.
pub fn http2_prior_knowledge(self) -> ClientBuilder {
self.with_inner(|inner| inner.http2_prior_knowledge())