Handle Tomcat "noSlash error"

Hello guys,

I need some help to understand what strategies there is to handle this error.
Our app performs a request that returns a list of ids. Some of the ids are already enconded (ie: id=%2Fabc). Then we need to send that id to our servlet. And the servlet is immediately returning a 400 error.

Message Invalid URI: noSlash
Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

I also tried to add a servlet filter to re-encode our param, but unfortunately the filter is only triggered after the Tomcat validation.

So, what’re other options to handle this? There is something I can do so my filter is called before Tomcat validation?
As far as I read about, you can pass Tomcat an argument to allow slash encoding, but given that that configuration is customer’s responsibility, I don’t think that is actually a solution.

Thanks!
Luis

1 Like

A bit late for a reply, but I also ran into something similar.
An encoded forward slash / is blocked due to security settings. (See this post for details)

To get around that, you can replace %2F or the / with %252F (See this post for details) That link has details about changing the server settings, if you wanted to.

UPDATE: Never mind. %252F didn’t work for me. Hopefully it’ll work for you or you’ll be able to use the links I provided to find an alternative route.