@@ -109,7 +109,7 @@ ngx_http_modsecurity_store_ctx_header(ngx_http_request_t *r, ngx_str_t *name, ng
109109ngx_http_modsecurity_conf_t * mcf ;
110110ngx_http_modsecurity_header_t * hdr ;
111111
112- ctx = ngx_http_get_module_ctx ( r , ngx_http_modsecurity_module );
112+ ctx = ngx_http_modsecurity_get_module_ctx ( r );
113113if (ctx == NULL || ctx -> sanity_headers_out == NULL ){
114114return NGX_ERROR ;
115115 }
@@ -152,7 +152,7 @@ ngx_http_modsecurity_resolv_header_server(ngx_http_request_t *r, ngx_str_t name,
152152ngx_str_t value ;
153153
154154clcf = ngx_http_get_module_loc_conf (r , ngx_http_core_module );
155- ctx = ngx_http_get_module_ctx ( r , ngx_http_modsecurity_module );
155+ ctx = ngx_http_modsecurity_get_module_ctx ( r );
156156
157157if (r -> headers_out .server == NULL ){
158158if (clcf -> server_tokens ){
@@ -186,7 +186,7 @@ ngx_http_modsecurity_resolv_header_date(ngx_http_request_t *r, ngx_str_t name, o
186186ngx_http_modsecurity_ctx_t * ctx = NULL ;
187187ngx_str_t date ;
188188
189- ctx = ngx_http_get_module_ctx ( r , ngx_http_modsecurity_module );
189+ ctx = ngx_http_modsecurity_get_module_ctx ( r );
190190
191191if (r -> headers_out .date == NULL ){
192192date .data = ngx_cached_http_time .data ;
@@ -216,7 +216,7 @@ ngx_http_modsecurity_resolv_header_content_length(ngx_http_request_t *r, ngx_str
216216ngx_str_t value ;
217217char buf [NGX_INT64_LEN + 2 ];
218218
219- ctx = ngx_http_get_module_ctx ( r , ngx_http_modsecurity_module );
219+ ctx = ngx_http_modsecurity_get_module_ctx ( r );
220220
221221if (r -> headers_out .content_length_n > 0 )
222222{
@@ -243,7 +243,7 @@ ngx_http_modsecurity_resolv_header_content_type(ngx_http_request_t *r, ngx_str_t
243243{
244244ngx_http_modsecurity_ctx_t * ctx = NULL ;
245245
246- ctx = ngx_http_get_module_ctx ( r , ngx_http_modsecurity_module );
246+ ctx = ngx_http_modsecurity_get_module_ctx ( r );
247247
248248if (r -> headers_out .content_type .len > 0 )
249249{
@@ -270,7 +270,7 @@ ngx_http_modsecurity_resolv_header_last_modified(ngx_http_request_t *r, ngx_str_
270270u_char buf [1024 ], * p ;
271271ngx_str_t value ;
272272
273- ctx = ngx_http_get_module_ctx ( r , ngx_http_modsecurity_module );
273+ ctx = ngx_http_modsecurity_get_module_ctx ( r );
274274
275275if (r -> headers_out .last_modified_time == -1 ){
276276return 1 ;
@@ -302,7 +302,7 @@ ngx_http_modsecurity_resolv_header_connection(ngx_http_request_t *r, ngx_str_t n
302302ngx_str_t value ;
303303
304304clcf = ngx_http_get_module_loc_conf (r , ngx_http_core_module );
305- ctx = ngx_http_get_module_ctx ( r , ngx_http_modsecurity_module );
305+ ctx = ngx_http_modsecurity_get_module_ctx ( r );
306306
307307if (r -> headers_out .status == NGX_HTTP_SWITCHING_PROTOCOLS ){
308308connection = "upgrade" ;
@@ -353,7 +353,7 @@ ngx_http_modsecurity_resolv_header_transfer_encoding(ngx_http_request_t *r, ngx_
353353if (r -> chunked ){
354354ngx_str_t value = ngx_string ("chunked" );
355355
356- ctx = ngx_http_get_module_ctx ( r , ngx_http_modsecurity_module );
356+ ctx = ngx_http_modsecurity_get_module_ctx ( r );
357357
358358#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
359359ngx_http_modsecurity_store_ctx_header (r , & name , & value );
@@ -380,7 +380,7 @@ ngx_http_modsecurity_resolv_header_vary(ngx_http_request_t *r, ngx_str_t name, o
380380if (r -> gzip_vary && clcf -> gzip_vary ){
381381ngx_str_t value = ngx_string ("Accept-Encoding" );
382382
383- ctx = ngx_http_get_module_ctx ( r , ngx_http_modsecurity_module );
383+ ctx = ngx_http_modsecurity_get_module_ctx ( r );
384384
385385#if defined(MODSECURITY_SANITY_CHECKS ) && (MODSECURITY_SANITY_CHECKS )
386386ngx_http_modsecurity_store_ctx_header (r , & name , & value );
@@ -422,7 +422,7 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r)
422422
423423/* XXX: if NOT_MODIFIED, do we need to process it at all? see xslt_header_filter() */
424424
425- ctx = ngx_http_get_module_ctx ( r , ngx_http_modsecurity_module );
425+ ctx = ngx_http_modsecurity_get_module_ctx ( r );
426426
427427dd ("header filter, recovering ctx: %p" , ctx );
428428
0 commit comments