diff src/http/ngx_http_special_response.c @ 675:e924670896ab release-0.3.59

nginx-0.3.59-RELEASE import *) Feature: now is possible to do several redirection using the "error_page" directive. *) Bugfix: the "dav_access" directive did not support three parameters. *) Bugfix: the "error_page" directive did not changes the "Content-Type" header line after the "X-Accel-Redirect" was used; the bug had appeared in 0.3.58.
author Igor Sysoev <igor@sysoev.ru>
date Wed, 16 Aug 2006 13:09:33 +0000
parents b80f94fa2197
children 921a7ce4baf4
line wrap: on
line diff
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -336,9 +336,11 @@ ngx_http_special_response_handler(ngx_ht
         }
     }
 
+    r->headers_out.content_type.len = 0;
+
     clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
 
-    if (r->err_ctx == NULL && clcf->error_pages) {
+    if (clcf->error_pages) {
 
         err_page = clcf->error_pages->elts;
 
@@ -346,7 +348,6 @@ ngx_http_special_response_handler(ngx_ht
 
             if (err_page[i].status == error) {
                 r->err_status = err_page[i].overwrite;
-                r->err_ctx = r->ctx;
 
                 r->method = NGX_HTTP_GET;
 
@@ -370,8 +371,9 @@ ngx_http_special_response_handler(ngx_ht
                                         ngx_list_push(&r->headers_out.headers);
 
                 if (r->headers_out.location) {
+                    error = NGX_HTTP_MOVED_TEMPORARILY;
+
                     r->err_status = NGX_HTTP_MOVED_TEMPORARILY;
-                    error = NGX_HTTP_MOVED_TEMPORARILY;
 
                     r->headers_out.location->hash = 1;
                     r->headers_out.location->key.len = sizeof("Location") - 1;