7
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Posted at

ログ

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="[]|{}^\`" />
7
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?