Welcome! Log In Create A New Profile

Advanced

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

Maxim Dounin
September 24, 2018 02:02PM
Hello!

On Mon, Sep 24, 2018 at 08:34:37PM +0300, Gena Makhomed wrote:

> On 24.09.2018 19:25, Maxim Dounin wrote:
>
> >> What about adding 307 and 308 to list of default response codes?
>
> > I'm not a fan of the "proxy_cache_valid 5m" form for the very same
> > reasons, and would rather avoid changing it.
>
> Ok. What about more strict check for invalid status codes?
>
> # HG changeset patch
> # User Gena Makhomed <gmm@csdoc.com>
> # Date 1537810006 -10800
> # Mon Sep 24 20:26:46 2018 +0300
> # Node ID fc6c7e03edaad907d6a85afab009cb5c1fa43c56
> # Parent 17092295247709a533acca09f990c13337a24948
> 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.

Have you seen such configurations in the real life, or it is
something made-up while looking at the code?

>
> diff -r 170922952477 -r fc6c7e03edaa src/http/ngx_http_file_cache.c
> --- a/src/http/ngx_http_file_cache.c Wed Sep 19 09:26:47 2018 -0500
> +++ b/src/http/ngx_http_file_cache.c Mon Sep 24 20:26:46 2018 +0300
> @@ -2669,7 +2669,7 @@
> } 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

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Allow 1xx 2xx 3xx 4xx 5xx codes in xxxxx_cache_valid directives.

Gena Makhomed 392 September 21, 2018 07:26AM

Re: [PATCH] Allow 1xx 2xx 3xx 4xx 5xx codes in xxxxx_cache_valid directives.

Maxim Dounin 188 September 21, 2018 09:00AM

[PATCH] Add 307 and 308 to default response codes for xxxxx_cache_valid.

Gena Makhomed 200 September 21, 2018 11:36AM

Re: [PATCH] Add 307 and 308 to default response codes for xxxxx_cache_valid.

Maxim Dounin 174 September 24, 2018 12:26PM

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

Gena Makhomed 176 September 24, 2018 01:36PM

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

Maxim Dounin 186 September 24, 2018 02:02PM

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

Gena Makhomed 155 September 24, 2018 03:12PM

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

Maxim Dounin 215 September 24, 2018 07:34PM



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

Online Users

Guests: 137
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