]> granicus.if.org Git - apache/commitdiff
add 2 new enviornment variables to deal with misbehaving backends
authorIan Holsman <ianh@apache.org>
Fri, 31 May 2002 21:21:10 +0000 (21:21 +0000)
committerIan Holsman <ianh@apache.org>
Fri, 31 May 2002 21:21:10 +0000 (21:21 +0000)
"proxy-nokeepalive" which removes the Connection: line completely
"force-proxy-request-1.0" which forces the request to be HTTP/1.0
this allows apache to reverse proxy misbehaving appservers

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95456 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/proxy_http.c

index ee9c75da1bb155ab2af8c0053a42573a774c973f..245e34bc253dc1c786e8f25d17bfb72dbd36244f 100644 (file)
@@ -449,7 +449,15 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
         origin->keepalive = 0;
     }
 
-    buf = apr_pstrcat(p, r->method, " ", url, " HTTP/1.1" CRLF, NULL);
+    if ( apr_table_get(r->subprocess_env,"force-proxy-request-1.0")) {
+        buf = apr_pstrcat(p, r->method, " ", url, " HTTP/1.0" CRLF, NULL);
+    } else {
+        buf = apr_pstrcat(p, r->method, " ", url, " HTTP/1.1" CRLF, NULL);
+    }
+    if ( apr_table_get(r->subprocess_env,"proxy-nokeepalive")) {
+        apr_table_unset(r->headers_in, "Connection");
+        origin->keepalive = 0;
+    }
     ap_xlate_proto_to_ascii(buf, strlen(buf));
     e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
     APR_BRIGADE_INSERT_TAIL(bb, e);