aboutsummaryrefslogtreecommitdiff
path: root/src/https.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-12-07 18:50:58 +0100
committerAlex Auvolat <alex@adnab.me>2021-12-07 18:50:58 +0100
commit11c6f0b1c29b10893de9390f5be559de49e78410 (patch)
tree92a1208b960e390b034fdc59502b4b67789fd102 /src/https.rs
parente8b789f5e047c074af25dd814ed8309216d57e0f (diff)
downloadtricot-11c6f0b1c29b10893de9390f5be559de49e78410.tar.gz
tricot-11c6f0b1c29b10893de9390f5be559de49e78410.zip
Better handle get_cert for https request (faster path, hostname verification)
Diffstat (limited to 'src/https.rs')
-rw-r--r--src/https.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/https.rs b/src/https.rs
index 43a93e2..3621e4f 100644
--- a/src/https.rs
+++ b/src/https.rs
@@ -5,10 +5,10 @@ use anyhow::Result;
use log::*;
use futures::FutureExt;
+use http::header::{HeaderName, HeaderValue};
use hyper::server::conn::Http;
use hyper::service::service_fn;
use hyper::{Body, Request, Response, StatusCode};
-use http::header::{HeaderName, HeaderValue};
use tokio::net::TcpListener;
use tokio::sync::watch;
use tokio_rustls::TlsAcceptor;
@@ -121,7 +121,10 @@ async fn handle(
let mut response = reverse_proxy::call(remote_addr.ip(), &to_addr, req).await?;
for (header, value) in proxy_to.add_headers.iter() {
- response.headers_mut().insert(HeaderName::from_bytes(header.as_bytes())?, HeaderValue::from_str(value)?);
+ response.headers_mut().insert(
+ HeaderName::from_bytes(header.as_bytes())?,
+ HeaderValue::from_str(value)?,
+ );
}
Ok(response)