arrfab / rpms / httpd

Forked from rpms/httpd 5 years ago
Clone

Blame SOURCES/httpd-2.4.6-r1573626.patch

4126fd
--- a/modules/proxy/mod_proxy.c	2014/03/03 17:28:10	1573625
4126fd
+++ b/modules/proxy/mod_proxy.c	2014/03/03 17:28:17	1573626
4126fd
@@ -927,8 +927,25 @@
4126fd
     struct dirconn_entry *list = (struct dirconn_entry *)conf->dirconn->elts;
4126fd
 
4126fd
     /* is this for us? */
4126fd
-    if (!r->proxyreq || !r->filename || strncmp(r->filename, "proxy:", 6) != 0)
4126fd
+    if (!r->filename) {
4126fd
         return DECLINED;
4126fd
+    }
4126fd
+
4126fd
+    if (!r->proxyreq) {
4126fd
+        /* We may have forced the proxy handler via config or .htaccess */
4126fd
+        if (r->handler &&
4126fd
+            strncmp(r->handler, "proxy:", 6) == 0 &&
4126fd
+            strncmp(r->filename, "proxy:", 6) != 0) {
4126fd
+            r->proxyreq = PROXYREQ_REVERSE;
4126fd
+            r->filename = apr_pstrcat(r->pool, r->handler, r->filename, NULL);
4126fd
+            apr_table_setn(r->notes, "rewrite-proxy", "1");
4126fd
+        }
4126fd
+        else {
4126fd
+            return DECLINED;
4126fd
+        }
4126fd
+    } else if (strncmp(r->filename, "proxy:", 6) != 0) {
4126fd
+        return DECLINED;
4126fd
+    }
4126fd
 
4126fd
     /* handle max-forwards / OPTIONS / TRACE */
4126fd
     if ((str = apr_table_get(r->headers_in, "Max-Forwards"))) {