Welcome! Log In Create A New Profile

Advanced

proxy_cache when 'Authorization' HTTP header presents.

Kuramoto Eiji
August 11, 2009 10:47PM
Hi,

The proxy_cache module send cached contents until it's expired
even if a client send wrong user/password after passed first (401)
authentication. It might be a bug ... ?

small patch like this,


--- ngx_http_upstream.c 22 Jul 2009 04:01:25 -0000 1.7
+++ ngx_http_upstream.c 11 Aug 2009 10:01:41 -0000 1.8
@@ -397,7 +397,18 @@

#if (NGX_HTTP_CACHE)

+ /*
+ * don't cache when Authorization header presents.
+ */
+ if (u->conf->cache
+ && r->headers_in.authorization == NULL
+ && r->headers_in.user.data == NULL /* don't check 'len' for empty user/passwd */
+ && r->headers_in.passwd.data == NULL) {
ngx_int_t rc;

rc = ngx_http_upstream_cache(r, u);

- Kuramoto Eiji
Subject Author Posted

proxy_cache when 'Authorization' HTTP header presents.

Kuramoto Eiji August 11, 2009 10:47PM

Re: proxy_cache when 'Authorization' HTTP header presents.

Maxim Dounin August 17, 2009 10:14AM

Re: proxy_cache when 'Authorization' HTTP header presents.

Kuramoto Eiji August 18, 2009 07:38AM

Re: proxy_cache when 'Authorization' HTTP header presents.

Maxim Dounin August 18, 2009 08:25AM

Re: proxy_cache when 'Authorization' HTTP header presents.

Kuramoto Eiji August 19, 2009 10:36PM

Re: proxy_cache when 'Authorization' HTTP header presents.

Igor Sysoev August 18, 2009 10:13AM

Re: proxy_cache when 'Authorization' HTTP header presents.

Kuramoto Eiji August 19, 2009 11:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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