summaryrefslogtreecommitdiff
path: root/modules/proxy/proxy_http.c
diff options
context:
space:
mode:
authorBrian Pane <brianp@apache.org>2002-11-08 09:24:00 +0000
committerBrian Pane <brianp@apache.org>2002-11-08 09:24:00 +0000
commit05290b1d84b49c9e1a38d2f7c174e367cc9cefb4 (patch)
treef75579d38238ff39854287833fe999247bf4645e /modules/proxy/proxy_http.c
parentc0746450148ac58ec07d7deda05d44fafe426099 (diff)
downloadhttpd-05290b1d84b49c9e1a38d2f7c174e367cc9cefb4.tar.gz
When doing a GET of a proxied URL as a subrequest within
a POSTed request, don't send the original POST's Content-Length as part of the header for the GET. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97455 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy/proxy_http.c')
-rw-r--r--modules/proxy/proxy_http.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c
index ee80c67d3c..4720e7fe91 100644
--- a/modules/proxy/proxy_http.c
+++ b/modules/proxy/proxy_http.c
@@ -597,8 +597,27 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
|| !apr_strnatcasecmp(headers_in[counter].key, "If-None-Match")) {
continue;
}
+
+ /* If you POST to a page that gets server-side parsed
+ * by mod_include, and the parsing results in a reverse
+ * proxy call, the proxied request will be a GET, but
+ * its request_rec will have inherited the Content-Length
+ * of the original request (the POST for the enclosing
+ * page). We can't send the original POST's request body
+ * as part of the proxied subrequest, so we need to avoid
+ * sending the corresponding content length. Otherwise,
+ * the server to which we're proxying will sit there
+ * forever, waiting for a request body that will never
+ * arrive.
+ */
+ if ((r->method_number == M_GET) && headers_in[counter].key &&
+ !apr_strnatcasecmp(headers_in[counter].key,
+ "Content-Length")) {
+ continue;
+ }
}
+
buf = apr_pstrcat(p, headers_in[counter].key, ": ",
headers_in[counter].val, CRLF,
NULL);