且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

HTTP 错误代码 505

更新时间:2022-04-02 05:45:27

如果您在 HTTP 版本之后使用尾随空格向 Tomcat 发出请求(如您的示例中所示),Tomcat 将响应 505 错误.已在 Tomcat 7.0.27 上确认.

If you make a request to Tomcat with trailing whitespace after the HTTP version (as in your example), Tomcat will respond with 505 error. Confirmed on Tomcat 7.0.27.

RFC 2616 (HTTP 1.1) 规定 HTTP-Version"HTTP/" + digit + "." 组成.+ 数字.请求行以 " " + HTTP-Version + CRLF 结尾,这意味着在最后一位数字之后不允许有空格.

RFC 2616 (HTTP 1.1) says that the HTTP-Version is made up of "HTTP/" + digit + "." + digit. Request-Line ends with " " + HTTP-Version + CRLF which means no whitespace is allowed after that last digit.

参考文献: