Tomcat returns 505 for request URI with spaces

576 Views Asked by At

I'm using embedded Tomcat 9.0.13 in my springboot2 app sitting behind a nginx reverse proxy.

When I send a request with space, it returns 505. The request isn't even passed into the servlet so I am unable to add custom error handling in the application level.

How can I display a custom page for this 505 error? Also, is there a way to not treat this as a 505 and automatically encode the whitespaces?

eg URI: "http://app/hello world" "http://app/api?key=hello world"

1

There are 1 best solutions below

0
Zunaira Shafique On

try using character code for sapce in url param.