tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Fibbe <>
Subject URLDecoding not occurring for '+'
Date Wed, 16 Nov 2011 11:41:41 GMT

With the HEAD revision of tc7.0.x/trunk I get that spaces are translated into + symbols.

After binary searching which SVN rev in tomcat introduced this error, I found the following:
- 1189876 correctly URL-decodes the + sign into a space
- 1189899 doesn't URL-decode the + sign into a space anymore, which results in many + characters
on the server
  (and in our DB).

Looking into the SVN rev and looking into{Encoder,Decoder} I saw
that one case was left out in parsing parameters, so I tried the following
patch on the HEAD rev (r1202638):

Index: java/org/apache/tomcat/util/http/
--- java/org/apache/tomcat/util/http/    (revision 1202638)
+++ java/org/apache/tomcat/util/http/    (working copy)
@@ -284,6 +284,7 @@
                     case '%':
+                    case '+':
                         // Decoding required
                         if (parsingName) {
                             decodeName = true;

This solves my issue and the + signs are now correctly URL-decoded into spaces again.

I hope this patch helps.

Best regards,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message