]> git.kaiwu.me - nginx.git/commit
Proxy: use zero Content-Length while discarding request body.
authorMaxim Dounin <mdounin@mdounin.ru>
Sat, 27 Apr 2024 15:18:13 +0000 (18:18 +0300)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Thu, 22 Oct 2026 13:05:26 +0000 (17:05 +0400)
commit148c75678cd4171338c31d4ed4c02411736d5fe9
tree8c48f3bef5a865cc5602ee2c667d9663b7db05e1
parent807e53d990e80b3a279e80d261213be1e06cc635
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.

Adapted for nginx: the same change is applied to the HTTP/2 proxy
module (proxy_http_version 2), which is not present in freenginx and
used r->headers_in.content_length_n in the same way.  With an HTTP/2
upstream, the stale length resulted in the request being rejected
by the upstream, since the stream was closed without the body.

Co-authored-by: Elijah Zupancic <e.zupancic@f5.com>
Signed-off-by: Elijah Zupancic <e.zupancic@f5.com>
Origin: <https://freenginx.org/hg/nginx/rev/51e0dc7137843feda75b497773f598d3836c60a1>
src/http/modules/ngx_http_proxy_module.c
src/http/modules/ngx_http_proxy_v2_module.c