Skip to content

Commit ef1168b

Browse files
committed
iis: drop Transfer-Encoding unconditionally when Content-Length is set
The previous fix used stricmp() to match "chunked" exactly, which misses Transfer-Encoding values like "chunked, chunked", "gzip, chunked", or anything with extra whitespace. Since ModSecurity always forwards the body with an explicit Content-Length immediately after this point, any Transfer-Encoding header copied from the original request is stale and must be removed regardless of its value. Delete unconditionally.
1 parent 03bbda9 commit ef1168b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎iis/mymodule.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,9 @@ apr_status_t WriteBodyCallback(request_rec *r, char *buf, unsigned int length)
11631163
// not possible
11641164
}
11651165

1166+
// Drop stale Transfer-Encoding; Content-Length is set immediately below.
1167+
pHttpRequest->DeleteHeader(HttpHeaderTransferEncoding);
1168+
11661169
hr = pHttpRequest->SetHeader(
11671170
HttpHeaderContentLength,
11681171
szLength,

0 commit comments

Comments
 (0)