From f2ff4b1276a1d947790cf8fbeb7726467ece5a72 Mon Sep 17 00:00:00 2001 From: Sebastien Blot Date: Wed, 6 May 2026 11:01:37 +0200 Subject: [PATCH] waf: remove transfer-encoding header if set --- lib/crowdsec.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/crowdsec.lua b/lib/crowdsec.lua index 71fa6c3..dbf196a 100644 --- a/lib/crowdsec.lua +++ b/lib/crowdsec.lua @@ -30,6 +30,7 @@ local APPSEC_HOST_HEADER = "x-crowdsec-appsec-host" local APPSEC_VERB_HEADER = "x-crowdsec-appsec-verb" local APPSEC_URI_HEADER = "x-crowdsec-appsec-uri" local APPSEC_USER_AGENT_HEADER = "x-crowdsec-appsec-user-agent" +local APPSEC_TRANSFER_ENCODING_HEADER = "x-crowdsec-appsec-transfer-encoding" local REMEDIATION_API_KEY_HEADER = 'x-api-key' local METRICS_PERIOD = 900 @@ -605,6 +606,10 @@ function csmod.AppSecCheck(ip) if headers["content-length"] == nil then headers["content-length"] = tostring(#body) end + if headers["transfer-encoding"] ~= nil then + headers[APPSEC_TRANSFER_ENCODING_HEADER] = headers["transfer-encoding"] + headers["transfer-encoding"] = nil + end end else headers["content-length"] = nil