]> git.kaiwu.me - nginx.git/commitdiff
merge r2954:
authorIgor Sysoev <igor@sysoev.ru>
Mon, 22 Jun 2009 09:32:03 +0000 (09:32 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 22 Jun 2009 09:32:03 +0000 (09:32 +0000)
fix segfault if there is error_page 401, proxy_intercept_errors is on
and backend does not return "WWW-Authenticate" header

src/http/ngx_http_upstream.c

index 67ae1bc1ce11331fbc34d22f252f6b565022c6b2..c04e643fbfe2b203da9942f5b502e7f9b930caa8 100644 (file)
@@ -1573,8 +1573,9 @@ ngx_http_upstream_intercept_errors(ngx_http_request_t *r,
 
         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) {