# HG changeset patch # User Igor Sysoev # Date 1245663123 0 # Node ID b0c1ce16b5bd79745c88691a6098ab39db2340a5 # Parent 19f9a5eae383048a2b9276b26ba6ae084f093135 merge r2954: fix segfault if there is error_page 401, proxy_intercept_errors is on and backend does not return "WWW-Authenticate" header diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- 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) {