Skip to content

Commit

Permalink
Discard request body when redirecting to a URL via error_page.
Browse files Browse the repository at this point in the history
Reported by Bert JW Regeer and Francisco Oca Gonzalez.
  • Loading branch information
mdocguard committed Dec 23, 2019
1 parent 4c031f9 commit c1be55f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/http/ngx_http_special_response.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c1be55f

Please sign in to comment.