Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

ログ

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="[]|{}^\`" />
town-inc
私たちは、クラウドを主軸としてさまざまな市場にITを浸透させ、永続的に成長するITカンパニーをめざしています。
https://town.biz/
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