# HG changeset patch # User Maxim Dounin <mdou...@mdounin.ru> # Date 1713574630 -10800 # Sat Apr 20 03:57:10 2024 +0300 # Node ID c485429c713b5d24ba8329e95164b517cf8a1b87 # Parent 0946ec7c4a6a26fda6ed03cb1f1f877984ec5614 Proxy: use zero Content-Length while discarding request body.
Previously, r->headers_in.content_length_n was used, which is not 0 till the request body is fully discarded, and the request might hang. diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -1341,6 +1341,9 @@ ngx_http_proxy_create_request(ngx_http_r ctx->internal_body_length = -1; ctx->internal_chunked = 1; + } else if (r->discard_body) { + ctx->internal_body_length = 0; + } else { ctx->internal_body_length = r->headers_in.content_length_n; } -- nginx-devel mailing list nginx-devel@freenginx.org https://freenginx.org/mailman/listinfo/nginx-devel