Skip to content

Commit c1be55f

Browse files
committed
Discard request body when redirecting to a URL via error_page.
Reported by Bert JW Regeer and Francisco Oca Gonzalez.
1 parent 4c031f9 commit c1be55f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: src/http/ngx_http_special_response.c

+6
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,12 @@ ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)
623623
return ngx_http_named_location(r, &uri);
624624
}
625625

626+
r->expect_tested = 1;
627+
628+
if (ngx_http_discard_request_body(r) != NGX_OK) {
629+
r->keepalive = 0;
630+
}
631+
626632
location = ngx_list_push(&r->headers_out.headers);
627633

628634
if (location == NULL) {

0 commit comments

Comments
 (0)