Klaus Demo nginx / 5a2ce3f
Fixed "return" with discarding invalid chunked body. When ngx_http_discard_request_body() call was added to ngx_http_send_response(), there were no return codes other than NGX_OK and NGX_HTTP_INTERNAL_SERVER_ERROR. Now it can also return NGX_HTTP_BAD_REQUEST, but ngx_http_send_response() still incorrectly transforms it to NGX_HTTP_INTERNAL_SERVER_ERROR. The fix is to propagate ngx_http_discard_request_body() errors. Sergey Kandaurov 2 months ago
1 changed file(s) with 4 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
16591659 ngx_buf_t *b;
16601660 ngx_chain_t out;
16611661
1662 if (ngx_http_discard_request_body(r) != NGX_OK) {
1663 return NGX_HTTP_INTERNAL_SERVER_ERROR;
1662 rc = ngx_http_discard_request_body(r);
1663
1664 if (rc != NGX_OK) {
1665 return rc;
16641666 }
16651667
16661668 r->headers_out.status = status;