]> git.kaiwu.me - nginx.git/commitdiff
Discard request body when redirecting to a URL via error_page.
authorRuslan Ermilov <ru@nginx.com>
Mon, 23 Dec 2019 12:45:46 +0000 (15:45 +0300)
committerRuslan Ermilov <ru@nginx.com>
Mon, 23 Dec 2019 12:45:46 +0000 (15:45 +0300)
Reported by Bert JW Regeer and Francisco Oca Gonzalez.

src/http/ngx_http_special_response.c

index 4ffb2cc8ad65ef4eac559c3bdac72e398a9a9e20..76e6705889f8715bc83371c9111025983a134c45 100644 (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) {