Skip to content

Commit 11a35fb

Browse files
martinhsvzimmerle
authored andcommitted
Fix nginx not clearing body cache (caused by incomplete fix for #187)
1 parent 6da95bb commit 11a35fb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Diff for: CHANGES

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
v1.0.x - YYYY-MMM-DD (To be released)
22
-------------------------------------
33

4+
- Fix nginx not clearing body cache (caused by incomplete fix for #187)
5+
[Issue #216 - @krewi1, @martinhsv]
46
- Fix config setting not respected: client_body_in_file_only on
57
[Issue #187 - @martinhsv]
68
- Fix audit_log not generated for disruptive actions

Diff for: src/ngx_http_modsecurity_pre_access.c

+7
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ ngx_http_modsecurity_pre_access_handler(ngx_http_request_t *r)
104104
*/
105105
r->request_body_in_single_buf = 1;
106106
r->request_body_in_persistent_file = 1;
107+
if (!r->request_body_in_file_only) {
108+
// If the above condition fails, then the flag below will have been
109+
// set correctly elsewhere. We need to set the flag here for other
110+
// conditions (client_body_in_file_only not used but
111+
// client_body_buffer_size is)
112+
r->request_body_in_clean_file = 1;
113+
}
107114

108115
rc = ngx_http_read_client_request_body(r,
109116
ngx_http_modsecurity_request_read);

0 commit comments

Comments
 (0)