次のページを参考にしました。
[] を含むURLをGETしようとするとTomcatが400を返す
ブラウザーで次のようなメッセージが表示された時の対策です。
HTTP Status 400 – Bad Request
Type Exception Report
Message Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
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).
Exception
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
/var/lib/tomcat9/conf/server.xml に
relaxedPathChars と relaxedQueryChars を加えます。
/var/lib/tomcat9/conf/server.xml
(省略)
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
relaxedPathChars="[]|"
relaxedQueryChars="[]|{}^\`"
/>
(省略)
再起動
sudo systemctl restart tomcat9
状態の確認
sudo systemctl status tomcat9