]> git.kaiwu.me - nginx.git/commitdiff
Fix processing
authorIgor Sysoev <igor@sysoev.ru>
Wed, 30 Jun 2010 14:39:28 +0000 (14:39 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 30 Jun 2010 14:39:28 +0000 (14:39 +0000)
    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; }

src/http/ngx_http_core_module.c
src/http/ngx_http_header_filter_module.c

index 984d30617f53c26622cb1909d3da22bfa82816a3..1654510be0581044952cbbae6db0555ff9653e2f 100644 (file)
@@ -1748,6 +1748,7 @@ ngx_http_send_response(ngx_http_request_t *r, ngx_uint_t status,
     r->headers_out.status = status;
 
     if (status == NGX_HTTP_NO_CONTENT) {
+        r->header_only = 1;
         return ngx_http_send_header(r);
     }
 
index a8687d0a6da8e363728ecfdf34b503023ff0798f..bccf63624fab816e1f45cadb9b375986b073ca70 100644 (file)
@@ -170,6 +170,10 @@ ngx_http_header_filter(ngx_http_request_t *r)
 #endif
     u_char                     addr[NGX_SOCKADDR_STRLEN];
 
+    if (r->header_sent) {
+        return NGX_OK;
+    }
+
     r->header_sent = 1;
 
     if (r != r->main) {