diff src/http/ngx_http_special_response.c @ 4935:7bd1c839af3b

Request body: improved handling of incorrect chunked request body. While discarding chunked request body in some cases after detecting request body corruption no error was returned, while it was possible to correctly return 400 Bad Request. If error is detected too late, make sure to properly close connection. Additionally, in ngx_http_special_response_handler() don't return body of 500 Internal Server Error to a client if ngx_http_discard_request_body() fails, but disable keepalive and continue.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 26 Nov 2012 18:00:14 +0000
parents 812c4765c954
children 6b479db5b52b
line wrap: on
line diff
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -421,7 +421,7 @@ ngx_http_special_response_handler(ngx_ht
     r->expect_tested = 1;
 
     if (ngx_http_discard_request_body(r) != NGX_OK) {
-        error = NGX_HTTP_INTERNAL_SERVER_ERROR;
+        r->keepalive = 0;
     }
 
     if (clcf->msie_refresh