confirmed this is correct; no longer need to log

This commit is contained in:
Brandon Thomas
2020-07-01 03:38:16 -04:00
parent 0fda9f97c3
commit e7025d035f
+2 -2
View File
@@ -131,14 +131,14 @@ impl Router {
fn speak_proxy(req: Request<Body>, remote_addr: SocketAddr, router: Arc<Router>, endpoint: &'static str) -> BoxFut {
let mut headers = req.headers().clone();
// This is the correct client IP, not the IP of the load balancer.
// We're adding it to the headers so that downstream can use it for rate limiting and logging.
let forwarded_ip = HeaderValue::from_str(&remote_addr.ip().to_string())
.ok()
.unwrap_or(HeaderValue::from_static("127.0.0.1"));
headers.insert(HeaderName::from_static("forwarded"), forwarded_ip.clone());
headers.insert(HeaderName::from_static("x-forwarded-for"), forwarded_ip.clone());
info!("Remote IP: {:?}", remote_addr.ip().to_string());
Box::new(req.into_body().concat2().map(move |b| { // Builds a BoxedFut to return
let request_bytes = b.as_ref();