Mercurial > hg > nginx
diff src/http/modules/ngx_http_proxy_module.c @ 9252:51e0dc713784
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 27 Apr 2024 18:18:13 +0300 |
parents | d1cf09451ae8 |
children | 388a801e9bb9 |
line wrap: on
line diff
--- 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; }