From 58675a683b56f15bf99889c834541cc064ff3cc2 Mon Sep 17 00:00:00 2001 From: Julian Tescher Date: Fri, 28 Jun 2019 01:52:12 -0700 Subject: [PATCH] Do not decompress proxied responses (#151) If you decompress a proxied response that was encoded, the `content-encoding` header will be passed through but a plaintext body will be returned. --- http-full-proxy/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http-full-proxy/src/main.rs b/http-full-proxy/src/main.rs index 68a7d815..bcb788c3 100644 --- a/http-full-proxy/src/main.rs +++ b/http-full-proxy/src/main.rs @@ -15,7 +15,7 @@ fn forward( new_url.set_path(req.uri().path()); new_url.set_query(req.uri().query()); - let forwarded_req = client.request_from(new_url.as_str(), req.head()); + let forwarded_req = client.request_from(new_url.as_str(), req.head()).no_decompress(); let forwarded_req = if let Some(addr) = req.head().peer_addr { forwarded_req.header("x-forwarded-for", format!("{}", addr.ip())) } else {