]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
PR59815: rewrite per-directory + fcgi broken in 2.4.23
authorEric Covener <covener@apache.org>
Fri, 8 Jul 2016 21:49:47 +0000 (21:49 +0000)
committerEric Covener <covener@apache.org>
Fri, 8 Jul 2016 21:49:47 +0000 (21:49 +0000)
remove the query string from r->filename before calculating environment
(SCRIPT_FILENAME) in mod_proxy_fcgi.  Before PR59618, php-fpm would
see proxy:fcgi:// and do some of this same stripping.

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

modules/proxy/mod_proxy_fcgi.c

index b0d338d12f59ce12acb9a4fa39fdf7134c4e7f61..1be9a091f857a4f098ccfa833ededd29bb8327f2 100644 (file)
@@ -253,7 +253,6 @@ static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
     apr_status_t rv;
     apr_size_t avail_len, len, required_len;
     int next_elem, starting_elem;
-    char *proxyfilename = r->filename;
     fcgi_req_config_t *rconf = ap_get_module_config(r->request_config, &proxy_fcgi_module);
 
     if (rconf) { 
@@ -272,6 +271,13 @@ static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
         else if (!strncmp(r->filename, "proxy:fcgi://", 13)) {
             newfname = apr_pstrdup(r->pool, r->filename+13);
         }
+        /* Query string in environment only */
+        if (newfname && r->args && *r->args) { 
+            char *qs = strrchr(newfname, '?');
+            if (qs && !strcmp(qs+1, r->args)) { 
+                *qs = '\0';
+            }
+        }
 
         if (newfname) {
             newfname = ap_strchr(newfname, '/');
@@ -282,8 +288,6 @@ static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
     ap_add_common_vars(r);
     ap_add_cgi_vars(r);
  
-    r->filename = proxyfilename;
-
     /* XXX are there any FastCGI specific env vars we need to send? */
 
     /* XXX mod_cgi/mod_cgid use ap_create_environment here, which fills in