From f4b9bb129435f0567b186394a335278eef34843d Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 15 Apr 2025 15:38:15 +0100 Subject: [PATCH] proxy: minor content encoding fixes --- src/core/Handler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/Handler.cpp b/src/core/Handler.cpp index d923c50..c04c2ca 100644 --- a/src/core/Handler.cpp +++ b/src/core/Handler.cpp @@ -386,7 +386,7 @@ void CServerHandler::proxyPass(const Pistache::Http::Request& req, Pistache::Htt const auto HEADERS = req.headers().list(); for (auto& h : HEADERS) { const auto HNAME = std::string_view{h->name()}; - if (HNAME == "Cache-Control" || HNAME == "Connection" || HNAME == "Content-Length") { + if (HNAME == "Cache-Control" || HNAME == "Connection" || HNAME == "Content-Length" || HNAME == "Accept-Encoding") { Debug::log(TRACE, "Header in: {}: {} (DROPPED)", h->name(), req.headers().getRaw(h->name()).value()); continue; } @@ -423,6 +423,8 @@ void CServerHandler::proxyPass(const Pistache::Http::Request& req, Pistache::Htt Debug::log(TRACE, "Header out: Set-Cookie: {}", ss.str()); } + auto enc = req.getBestAcceptEncoding(); + response.setCompression(enc); response.send(resp.code(), resp.body()); }, [&](std::exception_ptr e) {