summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2019-12-23 15:45:46 +0300
committerRuslan Ermilov <ru@nginx.com>2019-12-23 15:45:46 +0300
commitc1be55f97211d38b69ac0c2027e6812ab8b1b94e (patch)
treebbc2fa99b6840a5e2290488de49d5596e8c46943
parent4c031f9a6a879bcc4e86f5b7d4177996c9bca4cd (diff)
Discard request body when redirecting to a URL via error_page.
Reported by Bert JW Regeer and Francisco Oca Gonzalez.
-rw-r--r--src/http/ngx_http_special_response.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c
index 4ffb2cc8a..76e670588 100644
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -623,6 +623,12 @@ ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)
return ngx_http_named_location(r, &uri);
}
+ r->expect_tested = 1;
+
+ if (ngx_http_discard_request_body(r) != NGX_OK) {
+ r->keepalive = 0;
+ }
+
location = ngx_list_push(&r->headers_out.headers);
if (location == NULL) {