@@ -101,7 +101,7 @@ ngx_http_modsecurity_header_out_t ngx_http_modsecurity_headers_out[] = {
101
101
102
102
#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
103
103
int
104
- ngx_http_modescurity_store_ctx_header (ngx_http_request_t * r , ngx_str_t * name , ngx_str_t * value )
104
+ ngx_http_modsecurity_store_ctx_header (ngx_http_request_t * r , ngx_str_t * name , ngx_str_t * value )
105
105
{
106
106
ngx_http_modsecurity_ctx_t * ctx ;
107
107
ngx_http_modsecurity_conf_t * mcf ;
@@ -167,7 +167,7 @@ ngx_http_modsecurity_resolv_header_server(ngx_http_request_t *r, ngx_str_t name,
167
167
}
168
168
169
169
#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
170
- ngx_http_modescurity_store_ctx_header (r , & name , & value );
170
+ ngx_http_modsecurity_store_ctx_header (r , & name , & value );
171
171
#endif
172
172
173
173
return msc_add_n_response_header (ctx -> modsec_transaction ,
@@ -196,7 +196,7 @@ ngx_http_modsecurity_resolv_header_date(ngx_http_request_t *r, ngx_str_t name, o
196
196
}
197
197
198
198
#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
199
- ngx_http_modescurity_store_ctx_header (r , & name , & date );
199
+ ngx_http_modsecurity_store_ctx_header (r , & name , & date );
200
200
#endif
201
201
202
202
return msc_add_n_response_header (ctx -> modsec_transaction ,
@@ -223,7 +223,7 @@ ngx_http_modsecurity_resolv_header_content_length(ngx_http_request_t *r, ngx_str
223
223
value .len = strlen (buf );
224
224
225
225
#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
226
- ngx_http_modescurity_store_ctx_header (r , & name , & value );
226
+ ngx_http_modsecurity_store_ctx_header (r , & name , & value );
227
227
#endif
228
228
return msc_add_n_response_header (ctx -> modsec_transaction ,
229
229
(const unsigned char * ) name .data ,
@@ -247,7 +247,7 @@ ngx_http_modsecurity_resolv_header_content_type(ngx_http_request_t *r, ngx_str_t
247
247
{
248
248
249
249
#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
250
- ngx_http_modescurity_store_ctx_header (r , & name , & r -> headers_out .content_type );
250
+ ngx_http_modsecurity_store_ctx_header (r , & name , & r -> headers_out .content_type );
251
251
#endif
252
252
253
253
return msc_add_n_response_header (ctx -> modsec_transaction ,
@@ -280,7 +280,7 @@ ngx_http_modsecurity_resolv_header_last_modified(ngx_http_request_t *r, ngx_str_
280
280
value .len = (int )(p - buf );
281
281
282
282
#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
283
- ngx_http_modescurity_store_ctx_header (r , & name , & value );
283
+ ngx_http_modsecurity_store_ctx_header (r , & name , & value );
284
284
#endif
285
285
286
286
return msc_add_n_response_header (ctx -> modsec_transaction ,
@@ -316,7 +316,7 @@ ngx_http_modsecurity_resolv_header_connection(ngx_http_request_t *r, ngx_str_t n
316
316
value .len = strlen ((char * )buf );
317
317
318
318
#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
319
- ngx_http_modescurity_store_ctx_header (r , & name2 , & value );
319
+ ngx_http_modsecurity_store_ctx_header (r , & name2 , & value );
320
320
#endif
321
321
322
322
msc_add_n_response_header (ctx -> modsec_transaction ,
@@ -333,7 +333,7 @@ ngx_http_modsecurity_resolv_header_connection(ngx_http_request_t *r, ngx_str_t n
333
333
value .len = strlen (connection );
334
334
335
335
#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
336
- ngx_http_modescurity_store_ctx_header (r , & name , & value );
336
+ ngx_http_modsecurity_store_ctx_header (r , & name , & value );
337
337
#endif
338
338
339
339
return msc_add_n_response_header (ctx -> modsec_transaction ,
@@ -354,7 +354,7 @@ ngx_http_modsecurity_resolv_header_transfer_encoding(ngx_http_request_t *r, ngx_
354
354
ctx = ngx_http_get_module_ctx (r , ngx_http_modsecurity_module );
355
355
356
356
#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
357
- ngx_http_modescurity_store_ctx_header (r , & name , & value );
357
+ ngx_http_modsecurity_store_ctx_header (r , & name , & value );
358
358
#endif
359
359
360
360
return msc_add_n_response_header (ctx -> modsec_transaction ,
@@ -381,7 +381,7 @@ ngx_http_modsecurity_resolv_header_vary(ngx_http_request_t *r, ngx_str_t name, o
381
381
ctx = ngx_http_get_module_ctx (r , ngx_http_modsecurity_module );
382
382
383
383
#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
384
- ngx_http_modescurity_store_ctx_header (r , & name , & value );
384
+ ngx_http_modsecurity_store_ctx_header (r , & name , & value );
385
385
#endif
386
386
387
387
return msc_add_n_response_header (ctx -> modsec_transaction ,
@@ -430,6 +430,10 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r)
430
430
return ngx_http_next_header_filter (r );
431
431
}
432
432
433
+ if (ctx -> intervention_triggered ) {
434
+ return ngx_http_next_header_filter (r );
435
+ }
436
+
433
437
/* XXX: can it happen ? already processed i mean */
434
438
/* XXX: check behaviour on 'ModSecurity off' */
435
439
@@ -488,7 +492,7 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r)
488
492
}
489
493
490
494
#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
491
- ngx_http_modescurity_store_ctx_header (r , & data [i ].key , & data [i ].value );
495
+ ngx_http_modsecurity_store_ctx_header (r , & data [i ].key , & data [i ].value );
492
496
#endif
493
497
494
498
/*
@@ -522,12 +526,12 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r)
522
526
old_pool = ngx_http_modsecurity_pcre_malloc_init (r -> pool );
523
527
msc_process_response_headers (ctx -> modsec_transaction , status , http_response_ver );
524
528
ngx_http_modsecurity_pcre_malloc_done (old_pool );
525
- ret = ngx_http_modsecurity_process_intervention (ctx -> modsec_transaction , r );
529
+ ret = ngx_http_modsecurity_process_intervention (ctx -> modsec_transaction , r , 0 );
526
530
if (r -> error_page ) {
527
531
return ngx_http_next_header_filter (r );
528
- }
532
+ }
529
533
if (ret > 0 ) {
530
- return ret ;
534
+ return ngx_http_filter_finalize_request ( r , & ngx_http_modsecurity_module , ret ) ;
531
535
}
532
536
533
537
/*
0 commit comments