Help us understand the problem. What is going on with this article?

[] を含むURLをGETしようとするとTomcatが400を返す

ログ

5 17, 2019 10:24:27 午前 org.apache.coyote.http11.AbstractHttp11Processor process
情報: Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

Tomcatのバージョン

$ /opt/tomcat/bin/version.sh
Server version: Apache Tomcat/7.0.91

7.0.76あたりからURLに渡せるパラメータの判別が厳密になった模様。

回避方法

https://tomcat.apache.org/tomcat-7.0-doc/config/http.html

relaxedPathChars
relaxedQueryChars
を指定することで回避します。

<Connector port="8080" protocol="HTTP/1.1" maxThreads="1000" enableLookups="false" maxSwallowSize="-1"
               URIEncoding="UTF-8"
               connectionTimeout="20000"
               redirectPort="8443"
               relaxedPathChars="[]|" relaxedQueryChars="[]|{}^\`" />
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした