Skip to content

Commit 0faad3a

Browse files
committed
modsecurity: do not run for subreqs and after internal redirect
1 parent c69316f commit 0faad3a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ngx_http_modsecurity_pre_access.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ngx_http_modsecurity_pre_access_handler(ngx_http_request_t *r)
4545
ngx_pool_t *old_pool;
4646
ngx_http_modsecurity_ctx_t *ctx;
4747

48-
if (r->error_page) {
48+
if (r != r->main || r->internal) {
4949
return NGX_DECLINED;
5050
}
5151

src/ngx_http_modsecurity_rewrite.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ngx_http_modsecurity_rewrite_handler_internal(ngx_http_request_t *r)
5151
ngx_http_modsecurity_conf_t *mcf;
5252
ngx_http_modsecurity_main_conf_t *mmcf;
5353

54-
if (r->error_page) {
54+
if (r != r->main || r->internal) {
5555
return NGX_DECLINED;
5656
}
5757

0 commit comments

Comments
 (0)