Add support for wss: scheme in hyper-boring

This commit is contained in:
Ivan Nikulin 2020-12-03 01:25:18 +00:00
parent f8ab082d59
commit 2fc44386af
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "hyper-boring"
version = "1.0.2"
version = "1.0.3"
authors = ["Steven Fackler <sfackler@gmail.com>", "Ivan Nikulin <ifaaan@gmail.com>"]
edition = "2018"
description = "Hyper TLS support via BoringSSL"

View File

@ -209,7 +209,12 @@ where
}
fn call(&mut self, uri: Uri) -> Self::Future {
let tls_setup = if uri.scheme() == Some(&Scheme::HTTPS) {
let is_tls_scheme = uri
.scheme()
.map(|s| s == &Scheme::HTTPS || s.as_str() == "wss")
.unwrap_or(false);
let tls_setup = if is_tls_scheme {
Some((self.inner.clone(), uri.clone()))
} else {
None