@@ -32,7 +32,8 @@ ngx_int_t ngx_http_redirectionio_match_on_response_status_header_filter(ngx_http
32
32
}
33
33
34
34
// Copy string
35
- redirect_status_code = redirectionio_action_get_status_code (ctx -> action , r -> headers_out .status );
35
+ ctx -> backend_response_status_code = r -> headers_out .status ;
36
+ redirect_status_code = redirectionio_action_get_status_code (ctx -> action , ctx -> backend_response_status_code );
36
37
37
38
if (redirect_status_code == 0 ) {
38
39
return ngx_http_redirectionio_headers_filter (r );
@@ -100,8 +101,8 @@ ngx_int_t ngx_http_redirectionio_headers_filter(ngx_http_request_t *r) {
100
101
// Copy specific headers
101
102
ngx_http_redirectionio_header_content_type_read (r , & header_map );
102
103
103
- ngx_log_debug1 (NGX_LOG_DEBUG_HTTP , r -> connection -> log , 0 , "http redirectionio filtering on response status code %d" , r -> headers_out . status );
104
- header_map = (struct REDIRECTIONIO_HeaderMap * )redirectionio_action_header_filter_filter (ctx -> action , header_map , r -> headers_out . status , conf -> show_rule_ids == NGX_HTTP_REDIRECTIONIO_ON );
104
+ ngx_log_debug1 (NGX_LOG_DEBUG_HTTP , r -> connection -> log , 0 , "http redirectionio filtering on response status code %d" , ctx -> backend_response_status_code );
105
+ header_map = (struct REDIRECTIONIO_HeaderMap * )redirectionio_action_header_filter_filter (ctx -> action , header_map , ctx -> backend_response_status_code , conf -> show_rule_ids == NGX_HTTP_REDIRECTIONIO_ON );
105
106
106
107
if (header_map == NULL ) {
107
108
ngx_log_debug0 (NGX_LOG_DEBUG_HTTP , r -> connection -> log , 0 , "http redirectionio no filter to add" );
@@ -197,7 +198,7 @@ static ngx_int_t ngx_http_redirectionio_create_filter_body(ngx_http_request_t *r
197
198
}
198
199
199
200
// Create body filter
200
- ctx -> body_filter = (struct REDIRECTIONIO_FilterBodyAction * )redirectionio_action_body_filter_create (ctx -> action , r -> headers_out . status );
201
+ ctx -> body_filter = (struct REDIRECTIONIO_FilterBodyAction * )redirectionio_action_body_filter_create (ctx -> action , ctx -> backend_response_status_code );
201
202
202
203
if (ctx -> body_filter != NULL ) {
203
204
// Remove content length header
0 commit comments