Welcome! Log In Create A New Profile

Advanced

[nginx] Cache: status must be less then 599 in *_cache_valid directives.

Maxim Dounin
September 24, 2018 07:34PM
details: http://hg.nginx.org/nginx/rev/b5ea47df9bee
branches:
changeset: 7359:b5ea47df9bee
user: Gena Makhomed <gmm@csdoc.com>
date: Mon Sep 24 20:26:46 2018 +0300
description:
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.

diffstat:

src/http/ngx_http_file_cache.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c
--- a/src/http/ngx_http_file_cache.c
+++ b/src/http/ngx_http_file_cache.c
@@ -2669,7 +2669,7 @@ ngx_http_file_cache_valid_set_slot(ngx_c
} 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;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Cache: status must be less then 599 in *_cache_valid directives.

Maxim Dounin 315 September 24, 2018 07:34PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 145
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready