HTTP响应数据超出内容长度时的代理/网关行为

时间:2013-07-17 06:50:50

标签: http httpresponse webproxy rfc2616 http-content-length

当http服务器发送数据大小超过内容长度的HTTP响应时,代理/网关应该如何表现? 删除它作为RFC不合规是一种方法,但看起来今天有很多实现/部署与此行为,这种变化将最终打破这些URL。

非常感谢任何见解/指示。

谢谢, 开发

1 个答案:

答案 0 :(得分:0)

如果数据大小超过内容长度,则线路上的剩余字节将被视为对下一个(流水线)请求的响应的一部分。

如果没有与该回复匹配的未完成请求,请参阅http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-26#section-3.3.3 -

   If the final response to the last request on a connection has been
   completely received and there remains additional data to read, a user
   agent MAY discard the remaining data or attempt to determine if that
   data belongs as part of the prior response body, which might be the
   case if the prior message's Content-Length value is incorrect.  A
   client MUST NOT process, cache, or forward such extra data as a
   separate response, since such behavior would be vulnerable to cache
   poisoning.