diff src/http/ngx_http_special_response.c @ 438:ce4f9ff90bfa NGINX_0_7_31

nginx 0.7.31 *) Change: now the "try_files" directive tests files only and ignores directories. *) Feature: the "fastcgi_split_path_info" directive. *) Bugfixes in an "Expect" request header line support. *) Bugfixes in geo ranges. *) Bugfix: in a miss case ngx_http_memcached_module returned the "END" line as response body instead of default 404 page body; the bug had appeared in 0.7.18. Thanks to Maxim Dounin. *) Bugfix: while SMTP proxying nginx issued message "250 2.0.0 OK" instead of "235 2.0.0 OK"; the bug had appeared in 0.7.22. Thanks to Maxim Dounin.
author Igor Sysoev <http://sysoev.ru>
date Mon, 19 Jan 2009 00:00:00 +0300
parents 6ebbca3d5ed7
children c8cfb6c462ef
line wrap: on
line diff
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -379,6 +379,8 @@ ngx_http_special_response_handler(ngx_ht
         }
     }
 
+    r->expect_tested = 1;
+
     if (ngx_http_discard_request_body(r) != NGX_OK) {
         error = NGX_HTTP_INTERNAL_SERVER_ERROR;
     }
@@ -431,11 +433,18 @@ static ngx_int_t
 ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)
 {
     u_char                     ch, *p, *last;
+    ngx_int_t                  overwrite;
     ngx_str_t                 *uri, *args, u, a;
     ngx_table_elt_t           *location;
     ngx_http_core_loc_conf_t  *clcf;
 
-    r->err_status = err_page->overwrite;
+    overwrite = err_page->overwrite;
+
+    if (overwrite && overwrite != NGX_HTTP_OK) {
+        r->expect_tested = 1;
+    }
+
+    r->err_status = overwrite;
 
     r->zero_in_uri = 0;