5
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

Organization

[] を含む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に渡せるパラメータの判別が厳密になった模様。

回避方法

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
Sign upLogin
5
Help us understand the problem. What are the problem?