mirror of
				https://github.com/nginx/nginx.git
				synced 2025-02-25 18:55:26 -06:00 
			
		
		
		
	fix case when regex locaiton runs the second time via internal redirect
This commit is contained in:
		| @@ -1378,15 +1378,17 @@ ngx_http_core_find_location(ngx_http_request_t *r) | |||||||
|             ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |             ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | ||||||
|                            "test location: ~ \"%V\"", &(*clcfp)->name); |                            "test location: ~ \"%V\"", &(*clcfp)->name); | ||||||
|  |  | ||||||
|             if ((*clcfp)->captures && r->captures == NULL) { |             if ((*clcfp)->captures) { | ||||||
|  |  | ||||||
|                 len = (NGX_HTTP_MAX_CAPTURES + 1) * 3; |                 len = (NGX_HTTP_MAX_CAPTURES + 1) * 3; | ||||||
|  |  | ||||||
|  |                 if (r->captures == NULL) { | ||||||
|                     r->captures = ngx_palloc(r->pool, len * sizeof(int)); |                     r->captures = ngx_palloc(r->pool, len * sizeof(int)); | ||||||
|                     if (r->captures == NULL) { |                     if (r->captures == NULL) { | ||||||
|                         return NGX_ERROR; |                         return NGX_ERROR; | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|  |             } | ||||||
|  |  | ||||||
|             n = ngx_regex_exec((*clcfp)->regex, &r->uri, r->captures, len); |             n = ngx_regex_exec((*clcfp)->regex, &r->uri, r->captures, len); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user