96af6c
diff --git a/modules/proxy/mod_proxy_uwsgi.c b/modules/proxy/mod_proxy_uwsgi.c
96af6c
index 792d35e..9dcbed1 100644
96af6c
--- a/modules/proxy/mod_proxy_uwsgi.c
96af6c
+++ b/modules/proxy/mod_proxy_uwsgi.c
96af6c
@@ -453,11 +453,8 @@ static int uwsgi_handler(request_rec *r, proxy_worker * worker,
96af6c
                          const char *proxyname, apr_port_t proxyport)
96af6c
 {
96af6c
     int status;
96af6c
-    int delta = 0;
96af6c
-    int decode_status;
96af6c
     proxy_conn_rec *backend = NULL;
96af6c
     apr_pool_t *p = r->pool;
96af6c
-    size_t w_len;
96af6c
     char server_portstr[32];
96af6c
     char *u_path_info;
96af6c
     apr_uri_t *uri;
96af6c
@@ -469,23 +466,14 @@ static int uwsgi_handler(request_rec *r, proxy_worker * worker,
96af6c
 
96af6c
     uri = apr_palloc(r->pool, sizeof(*uri));
96af6c
 
96af6c
-    /* ADD PATH_INFO */
96af6c
-#if AP_MODULE_MAGIC_AT_LEAST(20111130,0)
96af6c
-    w_len = strlen(worker->s->name);
96af6c
-#else
96af6c
-    w_len = strlen(worker->name);
96af6c
-#endif
96af6c
-    u_path_info = r->filename + 6 + w_len;
96af6c
-    if (u_path_info[0] != '/') {
96af6c
-        delta = 1;
96af6c
-    }
96af6c
-    decode_status = ap_unescape_url(url + w_len - delta);
96af6c
-    if (decode_status) {
96af6c
+    /* ADD PATH_INFO (unescaped) */
96af6c
+    u_path_info = ap_strchr(url + sizeof(UWSGI_SCHEME) + 2, '/');
96af6c
+    if (!u_path_info || ap_unescape_url(u_path_info) != OK) {
96af6c
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10100)
96af6c
-                      "unable to decode uri: %s", url + w_len - delta);
96af6c
+                      "unable to decode uwsgi uri: %s", url);
96af6c
         return HTTP_INTERNAL_SERVER_ERROR;
96af6c
     }
96af6c
-    apr_table_add(r->subprocess_env, "PATH_INFO", url + w_len - delta);
96af6c
+    apr_table_add(r->subprocess_env, "PATH_INFO", u_path_info);
96af6c
 
96af6c
 
96af6c
     /* Create space for state information */