How to get Tomcat to accept unbound brackets in urls?

I have never used Tomcat before, but I recently inherited a JSP project, and now I need to run it. I managed to install Tomcat 8.0 locally in Eclipse and everything works fine. I also installed Tomcat 8.0 on Ubuntu VPS. The application works fine, except for a small problem with the way it handles URLs.

The client application creates URLs with unopened square and curly braces in the parameters, for example:

GET /saveItems.json?items=[{%22json%22:%22here%22}]

As far as I would like to change the client application, I cannot. I just need to run this backend.

My local copy of the application handles this penalty. On the server, however, I get this error:

java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
    at org.apache.coyote.http11.AbstractNioInputBuffer.parseRequestLine(AbstractNioInputBuffer.java:286)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1504)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1460)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)

I was looking for settings that could affect this, without any luck. What am I missing here?

+4
1

Tomcat 8.0.39/8.5.9/7.0.73 HTTP. , version 8.0.42/8.5.12/7.0.76 , .
{, } | , , tomcat.util.http.parser.HttpParser.requestTargetAllow.

tomcat.util.http.parser.HttpParser.requestTargetAllow={}, . $CATALINA_HOME\conf\catalina.properties.

+3

Source: https://habr.com/ru/post/1677299/


All Articles