MEDIUM: h1: generate WebSocket key on response if needed
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 11 Dec 2020 16:53:03 +0000 (17:53 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 28 Jan 2021 15:37:14 +0000 (16:37 +0100)
commitc193823343192014e7ebfe99a9bb1562c83ec81e
treec73a6ffd3832292d90d24514b333df130082d837
parent18ee5c3eb0c8afc18627a0d9a096aabb4c61e34f
MEDIUM: h1: generate WebSocket key on response if needed

Add the Sec-Websocket-Accept header on a websocket handshake response.
This header may be missing if a h2 server is used with a h1 client.

The response key is calculated following the rfc6455. For this, the
handshake request key must be stored in the h1 session, as a new field
name ws_key. Note that this is only done if the message has been
prealably identified as a Websocket handshake request.
include/haproxy/h1.h
src/h1.c
src/mux_h1.c