I try send request like http://site.com/abc%2Fabc and it doesn't work (send status 400). How I understand tomcat doesn't accept encoded path separators for security reasons, but I don't know how to enable this coding. (I have found only option AllowEncodedSlashes for apache http server). Can you help me?
UPDATE
I fixed this trouble using tiny hack - before render replace all '/' characters on '|' and after reverse this characters on '/'
In java, use this: str = str. replace("\\", "/");
Summary: The Backslash and Forward SlashThe backslash (\) is mostly used in computing and isn't a punctuation mark. The forward slash (/) can be used in place of “or” in less formal writing. It's also used to write dates, fractions, abbreviations, and URLs.
You can use forward slashes ( / ) instead of backward slashes ( \ ) on Windows (as is the case with Linux® and UNIX). If you use backward-slashes, the file name on Windows might be treated as a relative-path instead of an absolute-path.
There is a Tomcat option to allow encoded path separators.
Set the CATALINA_OPTS env var to
-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
This will allow encoded slashes.
We can also add this entry "org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true" in catalina.properties to allow encoded slash in url.
And to allow backslash you have to set different properties. Refer this url for different configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With