Bug 34475 - Problem with "//" in url
Summary: Problem with "//" in url
Status: RESOLVED DUPLICATE of bug 34474
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Connector:AJP (show other bugs)
Version: 5.0.28
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2005-04-15 17:05 UTC by Alessandro Iurlano
Modified: 2005-04-15 09:06 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Iurlano 2005-04-15 17:05:05 UTC
I had a webapp running on a tomcat 5.0.28 and visible through the ajp/1.3
connector via apache
This webapp generates urls to itself with // in them. When it is configured to
access the tomcat via the http connector it works correctly, but when it is
configured to operate via the ajp connector, the url is not reached.
I've noticed that this webapps works correctly on mod_jk 1.2.5.
I've had this problem on mod_jk 1.2.10
Having spent all the day to debug this problem, I think I've figured where it hides.
The code in mod_jk.c uses ap_no2slash(clean_uri) to remove double slashes in
jk_translate(). I think this happens registering workers base url to be fetched
later at the time to forward the uris.
Adding an ap_no2slash() in /jk/native/common/jk_uri_worker_map.c seems to fix
the problem. I don't know if this is right, because I've got almost no knowledge
of jk or apache internals. But now it seems to be working. Here is a patch:

--- jk_uri_worker_map.c.old     2005-04-15 14:49:10.000000000 +0000
+++ jk_uri_worker_map.c 2005-04-15 11:05:23.000000000 +0000
@@ -454,6 +454,10 @@
     if (JK_IS_DEBUG_LEVEL(l))
         jk_log(l, JK_LOG_DEBUG, "Attempting to map URI '%s' from %d maps",
                uri, uw_map->size);
+    ap_no2slash(uri);
+    if (JK_IS_DEBUG_LEVEL(l))
+        jk_log(l, JK_LOG_DEBUG, "Attempting to map URI '%s' from %d maps",
+               uri, uw_map->size);
     for (i = 0; i < uw_map->size; i++) {
         uri_worker_record_t *uwr = uw_map->maps[i];
Comment 1 Remy Maucherat 2005-04-15 17:06:41 UTC

*** This bug has been marked as a duplicate of 34474 ***