comparison src/http/ngx_http_request.c @ 4511:83c26de984ef stable-1.0

Merge of r4473: Core: protection from cycles with named locations and post_action. Now redirects to named locations are counted against normal uri changes limit, and post_action respects this limit as well. As a result at least the following (bad) configurations no longer trigger infinite cycles: 1. Post action which recursively triggers post action: location / { post_action /index.html; } 2. Post action pointing to nonexistent named location: location / { post_action @nonexistent; } 3. Recursive error page for 500 (Internal Server Error) pointing to a nonexistent named location: location / { recursive_error_pages on; error_page 500 @nonexistent; return 500; }
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 05 Mar 2012 12:49:32 +0000
parents 4919fb357a5d
children
comparison
equal deleted inserted replaced
4510:d6c507a46c90 4511:83c26de984ef
2896 2896
2897 if (clcf->post_action.data == NULL) { 2897 if (clcf->post_action.data == NULL) {
2898 return NGX_DECLINED; 2898 return NGX_DECLINED;
2899 } 2899 }
2900 2900
2901 if (r->post_action && r->uri_changes == 0) {
2902 return NGX_DECLINED;
2903 }
2904
2901 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 2905 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
2902 "post action: \"%V\"", &clcf->post_action); 2906 "post action: \"%V\"", &clcf->post_action);
2903 2907
2904 r->main->count--; 2908 r->main->count--;
2905 2909