Issue 30 in urlrewritefilter: ":" char in url results in java.io.UnsupportedEncodingException

View: New views
1 Messages — Rating Filter:   Alert me  

Issue 30 in urlrewritefilter: ":" char in url results in java.io.UnsupportedEncodingException

by codesite-noreply :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Comment #3 on issue 30 by fo...@...: ":" char in url results in  
java.io.UnsupportedEncodingException
http://code.google.com/p/urlrewritefilter/issues/detail?id=30

I can confirm this issue. The error occurs, when a parameter contains a  
colon. At our
site, for example, we have the following rule for rewriting search queries:

        <rule>
                <name>redirect /search/SEARCH</name>
                <condition type="parameter" name="search">(.+)</condition>
                <from>^/+search$</from>
                <to type="redirect" last="true">/search/${escape:%1}</to>
        </rule>

The following query results in a UnsupportedEncodingException as described  
above:

http://<ourhost>/search?search=test:

The reason for this exception is found in StringFunctions.java. If a  
parameter
contains a colon (':'), the prefix is treaded as an encoding name:

         String encoding = "UTF-8";
         if ( FIND_COLON_PATTERN.matcher(subject).find()) {
             encoding = subject.substring(0, subject.indexOf(':'));
             subject = subject.substring(subject.indexOf(':')+1);
         }

I didn't find this feature's documentation and I strongly suggest to  
disable it - or
at least make it optional.




--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
To post to this group, send email to urlrewrite@...
To unsubscribe from this group, send email to urlrewrite+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en
-~----------~----~----~----~------~----~------~--~---