summaryrefslogtreecommitdiffstats
path: root/modules/generators
diff options
context:
space:
mode:
authorEric Covener <covener@apache.org>2024-04-03 13:49:53 +0200
committerEric Covener <covener@apache.org>2024-04-03 13:49:53 +0200
commit61645eaac828e2603203d2dfafca938f22580655 (patch)
tree446974b971b84f35e4cb1d8cbacf3a42aa25cb44 /modules/generators
parentr1881790 has also added the 3rd argument to "ProxyRemoteMatch" (diff)
downloadapache2-61645eaac828e2603203d2dfafca938f22580655.tar.xz
apache2-61645eaac828e2603203d2dfafca938f22580655.zip
let httpd handle CL/TE for non-http handlers
Submitted By: ylavic, covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916769 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/generators')
-rw-r--r--modules/generators/cgi_common.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/modules/generators/cgi_common.h b/modules/generators/cgi_common.h
index 7aaf9b2793..7c985a7e1c 100644
--- a/modules/generators/cgi_common.h
+++ b/modules/generators/cgi_common.h
@@ -26,6 +26,7 @@
#include "httpd.h"
#include "util_filter.h"
+#include "util_script.h"
static APR_OPTIONAL_FN_TYPE(ap_ssi_get_tag_and_value) *cgi_pfn_gtv;
static APR_OPTIONAL_FN_TYPE(ap_ssi_parse_string) *cgi_pfn_ps;
@@ -428,9 +429,18 @@ static int cgi_handle_response(request_rec *r, int nph, apr_bucket_brigade *bb,
char sbuf[MAX_STRING_LEN];
int ret;
- if ((ret = ap_scan_script_header_err_brigade_ex(r, bb, sbuf,
- APLOG_MODULE_INDEX)))
- {
+ ret = ap_scan_script_header_err_brigade_ex(r, bb, sbuf,
+ APLOG_MODULE_INDEX);
+
+ /* xCGI has its own body framing mechanism which we don't
+ * match against any provided Content-Length, so let the
+ * core determine C-L vs T-E based on what's actually sent.
+ */
+ if (!apr_table_get(r->subprocess_env, AP_TRUST_CGILIKE_CL_ENVVAR))
+ apr_table_unset(r->headers_out, "Content-Length");
+ apr_table_unset(r->headers_out, "Transfer-Encoding");
+
+ if (ret != OK) {
/* In the case of a timeout reading script output, clear
* the brigade to avoid a second attempt to read the
* output. */