Discard request body when redirecting to a URL via error_page.

Reported by Bert JW Regeer and Francisco Oca Gonzalez.
This commit is contained in:
Ruslan Ermilov 2019-12-23 15:45:46 +03:00
parent 4c031f9a6a
commit c1be55f972

View File

@ -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) {