tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Weinrich" <>
Subject Url Encoding/Decoding and static resources
Date Thu, 28 Dec 2000 07:21:16 GMT
Hello again!

  I have run into something of an issue with tomcat 3.2.1 and 4.0 and
urls/filenames that include funky/reserved characters ( the most
common/troublesome being # so far ). To fix this I read rfc1738 on the 'proper' way to handle these
issues and found the answer in section 2.2 "URL Character Encoding Issues".

  After fixing my webapp to encode these characters in the proper way, I
found that apache handled the urls and served out the resources correctly,
but Tomcat 3.2.1 and 4.0 didn't. Actually 4.0 handled the most common
character ( space or %20 ) but didn't handle other encoded characters, and
3.2.1 didn't handle any encoded characters ( if my memory serves me
correcly ). After digging through the source I was able to put minor changes
into a few files in 4.0 and one file in 3.2.1 that allowed both servers to
handle these URLs correctly for all of the test cases I have that previously
failed. I'll attach the patches for 4.0 now, I still want to go back over
the 3.2 patches one more time and make sure I didn't miss anything.

  I attempted to handle all of the difficult situations that unencoding the
URL might pose ( inserting control characters and/or trying to get to a file
outside the appropriate area ), but there might be security/implementation
issues that I missed. Also, it could very well be the case that these are
not the right places to fix this particular problem, my apologies if I
missed the mark ;) Thanks again and I should have the 3.2 patch worked over
by tomorrow afternoon or so.

David Weinrich

View raw message