diff options
author | Yann Ylavic <ylavic@apache.org> | 2020-12-03 17:10:08 +0100 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2020-12-03 17:10:08 +0100 |
commit | 11758dc66af7210469a3519bf99574b800fd25fd (patch) | |
tree | 4ed9eba8cc20ec205e64d75a707522ff83ee4b98 /modules/proxy/mod_proxy_fcgi.c | |
parent | mod_proxy_fcgi: follow up to r1884068. (diff) | |
download | apache2-11758dc66af7210469a3519bf99574b800fd25fd.tar.xz apache2-11758dc66af7210469a3519bf99574b800fd25fd.zip |
mod_proxy_fcgi: follow up to r1884068 and r1884069.
No mixed Transfer-Encoding and Content-Length possible.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884070 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | modules/proxy/mod_proxy_fcgi.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index 1a40553f00..3382b9bfd5 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -1092,7 +1092,10 @@ static int proxy_fcgi_handler(request_rec *r, proxy_worker *worker, if (input_brigade == NULL) { const char *old_te = apr_table_get(r->headers_in, "Transfer-Encoding"); const char *old_cl = NULL; - if (!old_te) { + if (old_te) { + apr_table_unset(r->headers_in, "Content-Length"); + } + else { old_cl = apr_table_get(r->headers_in, "Content-Length"); } @@ -1140,8 +1143,8 @@ static int proxy_fcgi_handler(request_rec *r, proxy_worker *worker, * no body, do not set the Content-Length. */ if (old_cl || old_te || input_bytes) { - apr_table_set(r->headers_in, "Content-Length", - apr_off_t_toa(p, input_bytes)); + apr_table_setn(r->headers_in, "Content-Length", + apr_off_t_toa(p, input_bytes)); if (old_te) { apr_table_unset(r->headers_in, "Transfer-Encoding"); } @@ -1169,9 +1172,11 @@ static int proxy_fcgi_handler(request_rec *r, proxy_worker *worker, APR_BRIGADE_CONCAT(input_brigade, tmp_bb); input_bytes += remaining_bytes; - apr_table_unset(r->headers_in, "Transfer-Encoding"); - apr_table_set(r->headers_in, "Content-Length", - apr_off_t_toa(p, input_bytes)); + apr_table_setn(r->headers_in, "Content-Length", + apr_off_t_toa(p, input_bytes)); + if (old_te) { + apr_table_unset(r->headers_in, "Transfer-Encoding"); + } } } |