comparison src/http/ngx_http_file_cache.c @ 7359:b5ea47df9bee

Cache: status must be less then 599 in *_cache_valid directives. Previously, configurations with typo, for example fastcgi_cache_valid 200301 302 5m; successfully pass configuration test. Adding check for status codes > 599, and such configurations are now properly rejected.
author Gena Makhomed <gmm@csdoc.com>
date Mon, 24 Sep 2018 20:26:46 +0300
parents 7c614ef3c6ea
children de50fa05fbeb
comparison
equal deleted inserted replaced
7358:170922952477 7359:b5ea47df9bee
2667 status = 0; 2667 status = 0;
2668 2668
2669 } else { 2669 } else {
2670 2670
2671 status = ngx_atoi(value[i].data, value[i].len); 2671 status = ngx_atoi(value[i].data, value[i].len);
2672 if (status < 100) { 2672 if (status < 100 || status > 599) {
2673 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 2673 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2674 "invalid status \"%V\"", &value[i]); 2674 "invalid status \"%V\"", &value[i]);
2675 return NGX_CONF_ERROR; 2675 return NGX_CONF_ERROR;
2676 } 2676 }
2677 } 2677 }