"Firefox Developer Tools" > "Network" 中没有状态代码的原始 headers,这是一个错误吗?

Raw headers without status code in "Firefox Developer Tools" > "Network", is this a bug?

编辑:后来似乎有些浏览器将术语 "response headers" 与 "response message (without response body)" 混淆了。这就是这个问题出错的地方。浏览器不正确。同时我回答了我自己的问题。

在 Firefox 中,您可以通过 "Firefox Developer Tools" > "Network" 查看 "raw headers"。

原始响应示例 headers:

Date: Thu, 23 Nov 2017 12:43:21 GMT
Server: Apache/2.4.17 (Unix) OpenSSL/1.0.1e-fips PHP/5.6.16
Connection: Keep-Alive
Keep-Alive: timeout=1, max=100
Cache-Control: max-age=9, public
Vary: User-Agent

但我想念(例如):"HTTP/1.1 304 Not Modified"。 Firefox 在其他地方显示“304 Not Modified”,但不是 RAW。

所以他们让我认为我有原始形式的响应 headers,但实际上它只是响应 headers 的一部分,不包括状态代码。这真的会让人们感到困惑。 在我看来,在那个地方也添加 "status code" 会更有意义。现在真的不合逻辑了。

这是一个错误还是我必须如何看待它?

同时我可以回答我自己的问题。

此时,某些浏览器使用术语有误。他们混淆了“响应headers”和“响应消息(没有消息body)”。所以这就是为什么我问这个问题时感到困惑,这就是问题所在。

参见:https://www.rfc-editor.org/rfc/rfc7230#page-8(2.1.Client/Server 消息)

A server responds to a client's request by sending one or more HTTP response messages, each beginning with a status line that includes the protocol version, a success or error code, and textual reason phrase (Section 3.1.2), possibly followed by header fields containing server information, resource metadata, and representation metadata (Section 3.2), an empty line to indicate the end of the header section, and finally a message body containing the payload body (if any, Section 3.3).

所以换句话说。

回复消息:

Status line (ending with CRLF, so 2 extra Bytes)
Header field 1, in case of (ending with CRLF, so 2 extra Bytes)
Header field 2, in case of (ending with CRLF, so 2 extra Bytes)
Header field 3, et cetera (ending with CRLF, so 2 extra Bytes)
Empty line to indicate the end of the header section (CRLF, so 2 extra Bytes)
Message body / Response body, if any

响应HEADERS/响应HEADER 字段:

Header field 1 in case of (ending with CRLF, so 2 extra Bytes)
Header field 2 in case of (ending with CRLF, so 2 extra Bytes)
Header field 3 et cetera (ending with CRLF, so 2 extra Bytes)

所以正式地说 status-line 不是“响应 headers”的一部分,而只是“响应消息”的一部分。

Firefox 例如显示“响应 headers”的大小:“Firefox 开发人员工具”>“网络”> 单击行> Headers 选项卡。

此尺码还包括 i.a 的尺码。 status-line。原始响应的大小 headers 必须对应于此大小,但目前情况并非如此。因此,或者他们需要更改大小,或者他们必须在(原始)响应 headers 中额外包含“status-line”+“空行”,并且他们必须给它另一个名称(例如:response消息 - 消息 body).

Chrome也是这个错误。例如参见:https://developers.google.com/web/tools/chrome-devtools/network-performance/reference#requests

他们在那里说:

Size. The combined size of the response headers plus the response body, as delivered by the server.

但它们实际上意味着不同的东西(也根据实践中的大小值)。他们实际上是这个意思:

Size. The combined size of the response message, without the message body (instead of response headers) plus the response body, as delivered by the server.

所以实际上换句话说:

Size. The combined size of the response message, as delivered by the server.

这就是我的起源问题的来源。显然,目前这对浏览器来说是一个难题,因为我在 2 个浏览器中测试了它,但都出现了错误。

因此,如果人们认为 status-line 是响应 headers 的一部分,这并不奇怪。