diff options
Diffstat (limited to 'src/filters/proxy.rs')
-rw-r--r-- | src/filters/proxy.rs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/filters/proxy.rs b/src/filters/proxy.rs index 0e1a556..7cfc643 100644 --- a/src/filters/proxy.rs +++ b/src/filters/proxy.rs @@ -3,10 +3,7 @@ use http_body_util::{combinators::BoxBody, BodyExt}; use hyper::{ body::Incoming, header::UPGRADE, - http::{ - uri::{PathAndQuery, Scheme}, - HeaderValue, - }, + http::{uri::PathAndQuery, HeaderValue}, upgrade::OnUpgrade, Request, Uri, }; @@ -23,7 +20,6 @@ pub async fn proxy_request( #[cfg(feature = "mond")] state.reporting.request_out.inc(); - let scheme_secure = req.uri().scheme() == Some(&Scheme::HTTPS); *req.uri_mut() = Uri::builder() .path_and_query( req.uri() @@ -36,17 +32,9 @@ pub async fn proxy_request( .unwrap(); req.headers_mut().insert( - "x-forwarded-for", + "x-real-ip", HeaderValue::from_str(&format!("{addr}")).unwrap(), ); - req.headers_mut().insert( - "x-forwarded-proto", - if scheme_secure { - HeaderValue::from_static("https") - } else { - HeaderValue::from_static("http") - }, - ); let do_upgrade = req.headers().contains_key(UPGRADE); let on_upgrade_downstream = req.extensions_mut().remove::<OnUpgrade>(); |