changeset 2963:b0c1ce16b5bd stable-0.7

merge r2954: fix segfault if there is error_page 401, proxy_intercept_errors is on and backend does not return "WWW-Authenticate" header
author Igor Sysoev <igor@sysoev.ru>
date Mon, 22 Jun 2009 09:32:03 +0000
parents 19f9a5eae383
children e65e202792cb
files src/http/ngx_http_upstream.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1573,8 +1573,9 @@ ngx_http_upstream_intercept_errors(ngx_h
 
         if (err_page[i].status == status) {
 
-            if (status == NGX_HTTP_UNAUTHORIZED) {
-
+            if (status == NGX_HTTP_UNAUTHORIZED
+                && u->headers_in.www_authenticate)
+            {
                 h = ngx_list_push(&r->headers_out.headers);
 
                 if (h == NULL) {