You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2021/11/17 08:42:35 UTC

svn commit: r1895097 - in /httpd/httpd/branches/2.4.x: ./ changes-entries/uwsgi-path_info.txt modules/proxy/mod_proxy_uwsgi.c

Author: icing
Date: Wed Nov 17 08:42:35 2021
New Revision: 1895097

URL: http://svn.apache.org/viewvc?rev=1895097&view=rev
Log:
Merge of r1894074 from trunk:

  *) mod_proxy_uwsgi: Remove duplicate slashes at the beginning of PATH_INFO.
     PR 65616.  [Ruediger Pluem]


Added:
    httpd/httpd/branches/2.4.x/changes-entries/uwsgi-path_info.txt
      - copied unchanged from r1894074, httpd/httpd/trunk/changes-entries/uwsgi-path_info.txt
Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_uwsgi.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1894074

Modified: httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_uwsgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_uwsgi.c?rev=1895097&r1=1895096&r2=1895097&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_uwsgi.c (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_uwsgi.c Wed Nov 17 08:42:35 2021
@@ -471,14 +471,22 @@ static int uwsgi_handler(request_rec *r,
 
     /* ADD PATH_INFO (unescaped) */
     u_path_info = ap_strchr(url + sizeof(UWSGI_SCHEME) + 2, '/');
-    if (!u_path_info || ap_unescape_url(u_path_info) != OK) {
+    if (!u_path_info) {
+        u_path_info = apr_pstrdup(r->pool, "/");
+    }
+    else if (ap_unescape_url(u_path_info) != OK) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10100)
                       "unable to decode uwsgi uri: %s", url);
         return HTTP_INTERNAL_SERVER_ERROR;
     }
+    else {
+        /* Remove duplicate slashes at the beginning of PATH_INFO */
+        while (u_path_info[1] == '/') {
+            u_path_info++;
+        }
+    }
     apr_table_add(r->subprocess_env, "PATH_INFO", u_path_info);
 
-
     /* Create space for state information */
     status = ap_proxy_acquire_connection(UWSGI_SCHEME, &backend, worker,
                                          r->server);