content icon indicating copy to clipboard operation
content copied to clipboard

HTTP Sec-WebSocket-* headers

Open hamishwillee opened this issue 1 year ago • 3 comments
trafficstars

This adds some missing HTTP headers Sec-WebSocket-Protocol, Sec-WebSocket-Version, Sec-WebSocket-Extensions, Sec-WebSocket-Key,.

These are used in the WebSocket protocol. The docs are source from the spec, and existing docs like https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism

They don't convey much extra over those other docs, but they are where people expect them to be.

Related docs in #26731

We should probably add BCD for some of these - specifically Sec-WebSocket-Protocol, Sec-WebSocket-Version, and Sec-WebSocket-Protocol, Sec-WebSocket-Key are set by the browser in requests.

PS Note, I did not strip the information from https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism because doing so would make that document a bit pointless.

Fix #34852

hamishwillee avatar Aug 27 '24 07:08 hamishwillee

Preview URLs (8 pages)
Flaws (3)

Note! 5 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/HTTP/Headers/Sec-WebSocket-Extensions Title: Sec-WebSocket-Extensions Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: http.headers.Sec-WebSocket-Extensions

URL: /en-US/docs/Web/HTTP/Headers/Sec-WebSocket-Protocol Title: Sec-WebSocket-Protocol Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: http.headers.Sec-WebSocket-Protocol

URL: /en-US/docs/Web/HTTP/Headers/Sec-WebSocket-Version Title: Sec-WebSocket-Version Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: http.headers.Sec-WebSocket-Version
External URLs (4)

URL: /en-US/docs/Web/HTTP/Headers/Sec-WebSocket-Extensions Title: Sec-WebSocket-Extensions


URL: /en-US/docs/Web/HTTP/Headers/Sec-WebSocket-Protocol Title: Sec-WebSocket-Protocol


URL: /en-US/docs/Web/HTTP/Headers/Sec-WebSocket-Version Title: Sec-WebSocket-Version


URL: /en-US/docs/Web/API/WebSocket/WebSocket Title: WebSocket: WebSocket() constructor

(comment last updated: 2024-09-09 01:22:59)

github-actions[bot] avatar Aug 27 '24 07:08 github-actions[bot]

This would also fix https://github.com/mdn/content/issues/34852.

I do wonder if we can refactor the "Protocol upgrade mechanism" doc, but we should at least link to all these new header pages.

Josh-Cena avatar Aug 27 '24 14:08 Josh-Cena

I do wonder if we can refactor the "Protocol upgrade mechanism" doc, but we should at least link to all these new header pages.

It already does link in the headings (which I dislike). Refactoring is a "sensitive" job because most of the information is duplicated, but if you remove it the upgrade page is near empty.

So yes, but not as part of this.

hamishwillee avatar Aug 27 '24 22:08 hamishwillee

I don't feel confident reviewing this other than typesetting because I know nothing about WS; is Brian the only other committed HTTP reviewer?

Josh-Cena avatar Aug 30 '24 02:08 Josh-Cena

@Josh-Cena Fair enough! @bsmth Added you as reviewer since you're doing "HTTP Stuff". @chrisdavidmills might also comment since he did original WS docs.

hamishwillee avatar Aug 30 '24 02:08 hamishwillee

This pull request has merge conflicts that must be resolved before it can be merged.

github-actions[bot] avatar Aug 31 '24 23:08 github-actions[bot]

Thanks @bsmth - I've accepted your changes. Much appreciated.

hamishwillee avatar Sep 05 '24 23:09 hamishwillee

Thanks very much @bsmth!

hamishwillee avatar Sep 09 '24 01:09 hamishwillee