diff options
author | Alex Auvolat <alex@adnab.me> | 2021-12-08 17:50:40 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-12-08 17:50:40 +0100 |
commit | 3bdb417bfb87d7ef3381be2d56346a7995c54dde (patch) | |
tree | a1c1f503f9010c6af37e2098e9125b39219274da /src/reverse_proxy.rs | |
parent | 0e6e60d35a20d3c5e691f01e7f9372a390c18dea (diff) | |
download | tricot-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.rs | 6 |
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" { |