Open Bug 1924705 Opened 2 years ago Updated 2 years ago

Use the format defined in the specification for HTTP/2 Response/Request Headers

Categories

(DevTools :: Netmonitor, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: karlcow, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Hello,

This is a followup on a bug that I had initially opened on WebKit, but it seems WebKit is doing the right thing.
https://bugs.webkit.org/show_bug.cgi?id=263931

  1. With Safari
  2. Go to https://apple.com/ which is HTTP/2
  3. Open Web Inspector
  4. Network Tab
  5. Ctrl+click on a resource and Copy HTTP Response or Request Headers.

HTTP Request

:method: GET
:scheme: https
:authority: www.apple.com
:path: /
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Sec-Fetch-Site: none
Cookie: ****
Accept-Encoding: gzip, deflate, br
Sec-Fetch-Mode: navigate
Host: www.apple.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15
Accept-Language: en-US,en;q=0.9
Sec-Fetch-Dest: document
Connection: keep-alive

and the HTTP Response:

:status: 200
Content-Type: text/html; charset=utf-8
Vary: Accept-Encoding
Content-Security-Policy: *******
X-XSS-Protection: 1; mode=block
Content-Encoding: gzip
Expires: Mon, 30 Oct 2023 22:46:56 GMT
Referrer-Policy: no-referrer-when-downgrade
Cache-Control: max-age=94
Date: Mon, 30 Oct 2023 22:45:22 GMT
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Server: Apple
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
x-cache: *****

Firefox devtools will give a format which is similar to HTTP/1.1

The spec says for Response for example
https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2.4

8.1.2.4. Response Pseudo-Header Fields

For HTTP/2 responses, a single ":status" pseudo-header field is
defined that carries the HTTP status code field (see [RFC7231],
Section 6). This pseudo-header field MUST be included in all
responses; otherwise, the response is malformed (Section 8.1.2.6).

HTTP/2 does not define a way to carry the version or reason phrase
that is included in an HTTP/1.1 status line.

Flags: needinfo?(nchevobbe)
Attached image Chrome.png —

Thanks for reporting!

Tested Safari and Chrome and can confirm they show different formats for Http/2 vs HTTP 1.1.

We should also update the Request and Response headers in the Headers side panel. See attachments for differences between Firefox vs Chrome.

Severity: -- → S3
Flags: needinfo?(nchevobbe)
Priority: -- → P3
Summary: Copy HTTP Response/Request Headers for HTTP/2 deviates from the specification. → Use the format defined in the specification for HTTP/2 Response/Request Headers
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: