HTTP 响应的哪些部分使用 HTTP 压缩进行压缩?

What parts of HTTP response are compressed using HTTP compression?

通过阅读互联网上的资源,我得到的印象是只有 BODY 的响应被压缩了,因为你需要先阅读 'Content-Encoding' header 才能解压任何东西,如果已经压缩,浏览器无法解压。

稍后,我正在阅读有关 CRIME 攻击的文章,其中指出:

CRIME <...> is a security exploit against secret web cookies

这意味着网络 cookie 也被压缩,否则不会造成任何伤害。但是 Cookie 是在 header 秒内发送的,因此必须压缩一些 header 秒。

关于 HTTP 压缩压缩 HTTP 响应的哪些部分,我想要一个明确的答案。谢谢

编辑: 我的误解来自混淆 CRIME 和 BREACH。

CRIME 专注于 TLS 压缩,它使用 body 压缩 headers,因此包含 cookie。

BREACH 专注于 HTTP 级别的压缩,不涉及 Cookies :)

根据 RFC

,只有实体主体(即有效负载或表示)被压缩

The "Content-Encoding" header field indicates what content codings have been applied to the representation, beyond those inherent in the media type, and thus what decoding mechanisms have to be applied in order to obtain data in the media type referenced by the Content-Type header field. Content-Encoding is primarily used to allow a representation's data to be compressed without losing the identity of its underlying media type.