]> git.kaiwu.me - nginx.git/commitdiff
discard request body before returning 413 error,
authorIgor Sysoev <igor@sysoev.ru>
Tue, 1 Sep 2009 12:47:34 +0000 (12:47 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 1 Sep 2009 12:47:34 +0000 (12:47 +0000)
this fixes custom 413 page redirection bug introduced in r1456

src/http/ngx_http_core_module.c

index 8d83c440ea6de6cde8199ceac9e2f853497d702a..f99b91031296a89f40f51dcd657d164eb38c9820 100644 (file)
@@ -917,6 +917,7 @@ ngx_http_core_find_config_phase(ngx_http_request_t *r,
                       "client intended to send too large body: %O bytes",
                       r->headers_in.content_length_n);
 
+        (void) ngx_http_discard_request_body(r);
         ngx_http_finalize_request(r, NGX_HTTP_REQUEST_ENTITY_TOO_LARGE);
         return NGX_OK;
     }