Skip to content

Commit c69316f

Browse files
committed
modsecurity: correctly set response status in header filter
1 parent 65126a4 commit c69316f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ngx_http_modsecurity_header_filter.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r)
9292
msc_process_response_headers(ctx->modsec_transaction, r->headers_out.status,
9393
http_protocol);
9494
ngx_http_modsecurity_pcre_malloc_done(old_pool);
95+
9596
rc = ngx_http_modsecurity_process_intervention(ctx->modsec_transaction, r);
9697
if (rc > 0) {
97-
return rc;
98+
r->headers_out.status = rc;
99+
r->headers_out.status_line.len = 0;
98100
}
99101

100102
return ngx_http_next_header_filter(r);

0 commit comments

Comments
 (0)