# HG changeset patch # User Maxim Dounin # Date 1714231093 -10800 # Node ID 51e0dc7137843feda75b497773f598d3836c60a1 # Parent 3728a0ed243a5c2f4a54a5cc915474321e94e0b3 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; }