Bug 34474 - Problem with "//" in url
Summary: Problem with "//" in url
Status: RESOLVED FIXED
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
URL:
Keywords:
: 34475 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-15 16:51 UTC by Alessandro Iurlano
Modified: 2005-07-04 09:55 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Iurlano 2005-04-15 16:51:28 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:42 UTC
*** Bug 34475 has been marked as a duplicate of this bug. ***
Comment 2 jfclere 2005-07-04 16:25:42 UTC
fixing jk_uri_worker_map.c is wrong, mod_jk.c in jk_translate() is the place to
fix the problem.