Fix processing

error_page 502 504 /zero;
    location = /zero { return 204; }

The bug has been introduced in r3634.
The fix also allow to use:
    error_page 502 504 = /zero;
    location = /zero { return 200; }

This case still does not work:
    error_page 502 504 /zero;
    location = /zero { return 200; }
This commit is contained in:
Igor Sysoev 2010-06-30 14:39:28 +00:00
parent bcd78e22e9
commit ffcae99251
2 changed files with 5 additions and 0 deletions

View File

@ -1748,6 +1748,7 @@ ngx_http_send_response(ngx_http_request_t *r, ngx_uint_t status,
r->headers_out.status = status; r->headers_out.status = status;
if (status == NGX_HTTP_NO_CONTENT) { if (status == NGX_HTTP_NO_CONTENT) {
r->header_only = 1;
return ngx_http_send_header(r); return ngx_http_send_header(r);
} }

View File

@ -170,6 +170,10 @@ ngx_http_header_filter(ngx_http_request_t *r)
#endif #endif
u_char addr[NGX_SOCKADDR_STRLEN]; u_char addr[NGX_SOCKADDR_STRLEN];
if (r->header_sent) {
return NGX_OK;
}
r->header_sent = 1; r->header_sent = 1;
if (r != r->main) { if (r != r->main) {