aboutsummaryrefslogtreecommitdiff
path: root/src/reverse_proxy.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-12-08 17:50:40 +0100
committerAlex Auvolat <alex@adnab.me>2021-12-08 17:50:40 +0100
commit3bdb417bfb87d7ef3381be2d56346a7995c54dde (patch)
treea1c1f503f9010c6af37e2098e9125b39219274da /src/reverse_proxy.rs
parent0e6e60d35a20d3c5e691f01e7f9372a390c18dea (diff)
downloadtricot-3bdb417bfb87d7ef3381be2d56346a7995c54dde.tar.gz
tricot-3bdb417bfb87d7ef3381be2d56346a7995c54dde.zip
Exit more agressively on certain errors
Diffstat (limited to 'src/reverse_proxy.rs')
-rw-r--r--src/reverse_proxy.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/reverse_proxy.rs b/src/reverse_proxy.rs
index 1768724..401f4b1 100644
--- a/src/reverse_proxy.rs
+++ b/src/reverse_proxy.rs
@@ -72,7 +72,6 @@ fn create_proxied_request<B>(
*builder.headers_mut().unwrap() = remove_hop_headers(request.headers());
-
// If request does not have host header, add it from original URI authority
let host_header_name = "host";
if let Some(authority) = request.uri().authority() {
@@ -100,7 +99,10 @@ fn create_proxied_request<B>(
}
}
- builder.headers_mut().unwrap().insert(HeaderName::from_bytes(b"x-forwarded-proto")?, "https".try_into()?);
+ builder.headers_mut().unwrap().insert(
+ HeaderName::from_bytes(b"x-forwarded-proto")?,
+ "https".try_into()?,
+ );
if let Some(conn) = request.headers().get("connection") {
if conn.to_str()?.to_lowercase() == "upgrade" {