summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_special_response.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_special_response.c')
-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 ce6183e8b..035d4878f 100644
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -157,6 +157,12 @@ int ngx_http_special_response_handler(ngx_http_request_t *r, int error)
ngx_chain_t *out, **ll, *cl;
ngx_http_core_loc_conf_t *clcf;
+ rc = ngx_http_discard_body(r);
+
+ if (rc != NGX_OK) {
+ return rc;
+ }
+
r->headers_out.status = error;
if (error < NGX_HTTP_BAD_REQUEST) {