comparison src/http/ngx_http_upstream.c @ 2953:aa12525236da

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 Thu, 18 Jun 2009 14:28:50 +0000
parents 0998606fbfd4
children b4f39842523b
comparison
equal deleted inserted replaced
2952:0998606fbfd4 2953:aa12525236da
1604 err_page = clcf->error_pages->elts; 1604 err_page = clcf->error_pages->elts;
1605 for (i = 0; i < clcf->error_pages->nelts; i++) { 1605 for (i = 0; i < clcf->error_pages->nelts; i++) {
1606 1606
1607 if (err_page[i].status == status) { 1607 if (err_page[i].status == status) {
1608 1608
1609 if (status == NGX_HTTP_UNAUTHORIZED) { 1609 if (status == NGX_HTTP_UNAUTHORIZED
1610 1610 && u->headers_in.www_authenticate)
1611 {
1611 h = ngx_list_push(&r->headers_out.headers); 1612 h = ngx_list_push(&r->headers_out.headers);
1612 1613
1613 if (h == NULL) { 1614 if (h == NULL) {
1614 ngx_http_upstream_finalize_request(r, u, 1615 ngx_http_upstream_finalize_request(r, u,
1615 NGX_HTTP_INTERNAL_SERVER_ERROR); 1616 NGX_HTTP_INTERNAL_SERVER_ERROR);