ITeye博客

tomcat 8.5.31版本开始不支持 域名带下划线 "_"

dwangel · 2018-08-10 18:19 · tomcat · 编程语言 · Markdown

今天碰到上线的服务,无法访问,只是报 400 查了半天,发现域名里带 下划线 _ 即报400 改成减号(-)就可以正常访问。 查了半天。 原来是 8.5.31 开始严格的host检查……

Enable strict validation of the provided host name and port for all connectors. Requests with invalid host names and/or ports will be rejected with a 400 response. (markt)

http://tomcat.apache.org/tomcat-8.5-doc/changelog.html

8.5.32 有相关错误输出,但是碰到 _ 依然会 返回400,即使说了: Relax Host validation by removing the requirement that the final component of a FQDN must be alphabetic. (markt)

所以只好降 spring boot内嵌版本。 在maven的pom.xml里设个 <tomcat.version>8.5.30</tomcat.version>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。