Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2bf0300

Browse files
authored
Deleting Transfer-Encoding:chunked from request header as ModSecurity always sending Content-length (microsoft#13)
Deleting Transfer-Encoding:chunked from request header
1 parentd42c367 commit2bf0300

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎iis/mymodule.cpp‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,23 @@ apr_status_t WriteBodyCallback(request_rec *r, char *buf, unsigned int length)
11551155
// not possible
11561156
}
11571157

1158+
// Remove/Modify Transfer-Encoding header if "chunked" Encoding is set in the request.
1159+
// This is to avoid sending both Content-Length and Chunked Transfer-Encoding in the request header.
1160+
1161+
USHORT ctcch =0;
1162+
char *ct = (char *)pHttpRequest->GetHeader(HttpHeaderTransferEncoding, &ctcch);
1163+
if (ct)
1164+
{
1165+
char *ctz =ZeroTerminate(ct, ctcch, r->pool);
1166+
if (ctcch !=0)
1167+
{
1168+
if (0 ==stricmp(ctz,"chunked"))
1169+
{
1170+
pHttpRequest->DeleteHeader(HttpHeaderTransferEncoding);
1171+
}
1172+
}
1173+
}
1174+
11581175
hr = pHttpRequest->SetHeader(
11591176
HttpHeaderContentLength,
11601177
szLength,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp