Apache tomcat server.xml中的maxHttpHeaderSize和HttpServletRequest/HttpServletResponse中的content-length有什么不同。
maxHttpHeaderSize - The maximum size of the request and response HTTP header, specified in bytes. If not specified, this attribute is set to 4096 (4 KB).
content-Length -The Content-Length entity-header field indicates the size of the entity-body, in decimal number of OCTETs, sent to the recipient or, in the case of the HEAD method, the size of the entity-body that would have been sent had the request been a GET. 这两个参数之间有什么关系吗?
发布于 2015-07-08 20:08:24
两者之间没有直接联系。
content-length是一个HTTP header field,它以八位字节(8位字节)为单位指定请求主体的长度。它是所有HTTP请求的通用字段,与Apache Tomcat没有特定的连接。
maxHttpHeaderSize字段是Apache Tomcat配置文件中的一个配置字段-它限制服务器发送/接收的任何HTTP头的大小(我认为是出于安全/或网络优化的原因)。
HttpServletRequest/HttpServletResponse是用于为HTTP提供请求信息的接口:例如,您可以使用它来获取发送/接收的HTTP请求的CONTENT_LENGTH信息。
希望现在区别已经很明显了。如果您想更好地理解HTTP协议,请从Hypertext_Transfer_Protocol开始
https://stackoverflow.com/questions/31290787
复制相似问题