Add https_only() for ClientBuilder (#1102)

Closes #980
This commit is contained in:
Martin André
2020-12-09 19:40:46 +01:00
committed by GitHub
parent 474d9eff9b
commit 541d0c2aba
4 changed files with 70 additions and 0 deletions

View File

@@ -573,6 +573,13 @@ impl ClientBuilder {
self.with_inner(|inner| inner.no_trust_dns())
}
/// Restrict the Client to be used with HTTPS only requests.
///
/// Defaults to false.
pub fn https_only(self, enabled: bool) -> ClientBuilder {
self.with_inner(|inner| inner.https_only(enabled))
}
// private
fn with_inner<F>(mut self, func: F) -> ClientBuilder