0

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

将非常感谢任何见解/指针。

谢谢,开发

4

1 回答 1

0

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

如果没有与该响应匹配的未完成请求,请参阅https://datatracker.ietf.org/doc/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.
于 2014-02-20T00:31:50.513 回答