Skip to content

Commit 4114734

Browse files
committed
explicitly set exit status before calling log handler (attempt to fix audit log)
1 parent 515c03a commit 4114734

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ngx_http_modsecurity_module.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@ ngx_http_modsecurity_process_intervention (Transaction *transaction, ngx_http_re
207207

208208
if (intervention.status != 200)
209209
{
210+
/**
211+
* FIXME: this one will call msc_process_logging() but code may be
212+
* 200 instead of 403 by some reason.
213+
*
214+
*/
215+
r->err_status = intervention.status;
216+
r->headers_out.status = intervention.status;
217+
dd("intervention -- calling log handler manually with code: %d", intervention.status);
210218
ngx_http_modsecurity_log_handler(r);
211219
ctx->logged = 1;
212220

0 commit comments

Comments
 (0)