Bug 28350 - Tomcat with mod_jk does not serve up files with names containing % character
Summary: Tomcat with mod_jk does not serve up files with names containing % character
Status: RESOLVED INVALID
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: Common (show other bugs)
Version: unspecified
Hardware: All All
: P3 minor (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
: 28351 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-04-12 18:24 UTC by Jess Holle
Modified: 2008-10-05 03:13 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jess Holle 2004-04-12 18:24:13 UTC
With Tomcat 5.0.22, Apache 2.0.49, and mod_jk 1.2.6-dev (i.e. CVS head as of 
3/31/04):

1) Create a file (e.g. a text file) with a name containing a % character (e.g. 
foo%bar.txt).
2) Place it somewhere in the doc base of a web app.
3) Attempt to navigate to this document via a browser.

You'll be able to see such files in directory listings, but not download them 
(you get 404's instead)!

Note that the links for such files in the directory listings *do* have the % 
properly escaped as %25, but the request still does not work.  Note that using 
Tomcat 4.1.24 instead of 5.0.22 produces the same result.

Apache 2.0.49 has no such issues, though I believe some previous versions had 
issues in this area.

I am not certain which component of the architecture is at fault here.

I am actually more concerned with the overall treatment of % in path-info by 
mod_jk, Coyote, and Tomcat 4.1 and 5 than by the static file serving itself 
(which we use Apache for).  I have servlets which do not get requests when 
their path-info contains % characters.  I'll file a separate bug on this issue.
Comment 1 Remy Maucherat 2004-04-12 20:49:42 UTC
*** Bug 28351 has been marked as a duplicate of this bug. ***
Comment 2 william.barker 2004-04-12 21:14:52 UTC
You need to set either:
  JkOptions ForwardURICompatUnparsed
or
  JkOptions ForwardURIEscaped

to have mod_jk pass the encoded/escaped URI to Tomcat.  With the default value:
  JkOptions ForwardURICompat

mod_jk passes the decoded URI to Tomcat for backwards compatibility with 
earlier version of Tomcat.
Comment 3 Jess Holle 2004-04-12 21:18:52 UTC
Many thanks and sorry for the trouble.

Is there a similar option for mod_jk2 that I'm also overlooking?
Comment 4 Jess Holle 2004-04-12 22:02:14 UTC
Okay, "JkOptions +ForwardURIEscaped" works great, but how do you accomplish the
same thing with mod_jk2?

My servlets get called with uri's with path-infos containing %'s when I use
mod_jk and this option, but they don't get called with mod_jk2 and I can find no
such setting noted in the mod_jk2 docs.

Is this a gap in mod_jk2?