From e6df2d2a2d2565277dfb788cff52269865f8e991 Mon Sep 17 00:00:00 2001 From: Kouya Heika Date: Tue, 16 Sep 2025 04:46:55 -0500 Subject: [PATCH] strip Content-Length header to prevent duplicate --- src/core/Handler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Handler.cpp b/src/core/Handler.cpp index d590509..28374c0 100644 --- a/src/core/Handler.cpp +++ b/src/core/Handler.cpp @@ -447,7 +447,7 @@ void CServerHandler::proxyPassInternal(const Pistache::Http::Request& req, Pista const auto HEADERSRESP = resp.headers().list(); for (auto& h : HEADERSRESP) { - if (std::string_view{h->name()} == "Transfer-Encoding") { + if (std::string_view{h->name()} == "Transfer-Encoding" || std::string_view{h->name()} == "Content-Length") { Debug::log(TRACE, "Header out: {}: {} (DROPPED)", h->name(), resp.headers().getRaw(h->name()).value()); continue; } @@ -483,4 +483,4 @@ void CServerHandler::proxyPassInternal(const Pistache::Http::Request& req, Pista b.wait_for(std::chrono::seconds(g_pConfig->m_config.proxy_timeout_sec)); client.shutdown(); -} \ No newline at end of file +}