Skip to content

Commit

Permalink
Cache: status must be less then 599 in *_cache_valid directives.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gena Makhomed committed Sep 24, 2018
1 parent 8117b3f commit 1065455
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/http/ngx_http_file_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2669,7 +2669,7 @@ ngx_http_file_cache_valid_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
} else {

status = ngx_atoi(value[i].data, value[i].len);
if (status < 100) {
if (status < 100 || status > 599) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid status \"%V\"", &value[i]);
return NGX_CONF_ERROR;
Expand Down

0 comments on commit 1065455

Please sign in to comment.