【发布时间】:2019-06-09 23:15:27
【问题描述】:
我看到在this patch 中,Tomcat 在 9.0.8 中添加了一个选项以允许在 URL 中使用\。由于规范 RFC 7230 和 RFC 3986,我们有一些 PDF 会启动到页面,例如 https://mrbusche.com/?FilePath=\manuals\Commerciallines\eManual\az.pdf Tomcat 9.0.7 目前正在阻止 URL。
例外
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
这在 Tomcat 9.0.7 上根本不可能吗?
这是我的 Tomcat 连接器
<Connector
port="4005"
connectionTimeout="20000"
maxHttpHeaderSize="8192"
minSpareThreads="25"
enableLookups="false"
disableUploadTimeout="true"
acceptCount="100"
scheme="https"
secure="true"
URIEncoding="UTF-8"
protocol="org.apache.coyote.http11.Http11Nio2Protocol"
maxThreads="150"
relaxedQueryChars="\"
SSLEnabled="true" >
</Connector>
【问题讨论】:
-
我编辑了我的答案,消除了自鸣得意的语气。不是有意冒犯你。