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