]> git.kaiwu.me - nginx.git/commitdiff
fix segfault if there is error_page 401, proxy_intercept_errors is on
authorIgor Sysoev <igor@sysoev.ru>
Thu, 18 Jun 2009 14:28:50 +0000 (14:28 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 18 Jun 2009 14:28:50 +0000 (14:28 +0000)
and backend does not return "WWW-Authenticate" header

src/http/ngx_http_upstream.c

index edd48ac9fe397f8f17aef9c18fc7c08d95752f72..16a027a8a7c324bdc5d28c19d08cd7084d67744e 100644 (file)
@@ -1606,8 +1606,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) {