mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
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.
This commit is contained in:
@@ -1660,8 +1660,10 @@ ngx_http_send_response(ngx_http_request_t *r, ngx_uint_t status,
|
|||||||
ngx_buf_t *b;
|
ngx_buf_t *b;
|
||||||
ngx_chain_t out;
|
ngx_chain_t out;
|
||||||
|
|
||||||
if (ngx_http_discard_request_body(r) != NGX_OK) {
|
rc = ngx_http_discard_request_body(r);
|
||||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
|
||||||
|
if (rc != NGX_OK) {
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
r->headers_out.status = status;
|
r->headers_out.status = status;
|
||||||
|
Reference in New Issue
Block a user