summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-08-19 12:23:18 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-08-19 12:23:18 +0000
commitc9482c6ead7f239fcb3fc049df1a74652412e2dc (patch)
tree65910f3be59a49038e08dd78e7d7bceb1aa1096e
parent1de8bb5bd6575f652ba721474b37f189f988e31c (diff)
downloadnginx-c9482c6ead7f239fcb3fc049df1a74652412e2dc.tar.gz
nginx-c9482c6ead7f239fcb3fc049df1a74652412e2dc.tar.bz2
do not discard body while error_page redirection
-rw-r--r--src/http/ngx_http_special_response.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c
index fd33eaf70..4e045c701 100644
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -327,7 +327,6 @@ static ngx_str_t ngx_http_get_name = { 3, (u_char *) "GET " };
ngx_int_t
ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
{
- ngx_int_t rc;
ngx_uint_t i, err;
ngx_http_err_page_t *err_page;
ngx_http_core_loc_conf_t *clcf;
@@ -336,12 +335,6 @@ ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
"http special response: %d, \"%V?%V\"",
error, &r->uri, &r->args);
- rc = ngx_http_discard_request_body(r);
-
- if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) {
- error = NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
r->err_status = error;
if (r->keepalive) {
@@ -386,6 +379,10 @@ ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
}
}
+ if (ngx_http_discard_request_body(r) != NGX_OK) {
+ error = NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
+
if (clcf->msie_refresh
&& r->headers_in.msie
&& (error == NGX_HTTP_MOVED_PERMANENTLY