]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Lower the case for Sec-Websocket-* headers when manually added
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 24 Jul 2026 09:39:48 +0000 (11:39 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 24 Jul 2026 09:56:56 +0000 (11:56 +0200)
During the message formatting, if websocket handshake key must be added by
the mux itself, the corresponding headers were not inserted in lowercase as
expected. It is not really an issue but it is not consistant with processing
on other headers. So let's fix it.

src/mux_h1.c

index 2d9b13372e55132d036ea53cc7b91d607c10d0b5..a841e9cf313b303b297b543c486362fc0162a5cb 100644 (file)
@@ -2916,7 +2916,7 @@ static size_t h1_make_eoh(struct h1s *h1s, struct h1m *h1m, struct htx *htx, siz
                          */
                        h1_generate_random_ws_input_key(h1s->ws_key);
 
-                       if (!h1_format_htx_hdr(ist("Sec-Websocket-Key"),
+                       if (!h1_format_htx_hdr(ist("sec-websocket-key"),
                                               ist(h1s->ws_key),
                                               &outbuf, hdrs_map)) {
                                goto full;
@@ -2927,7 +2927,7 @@ static size_t h1_make_eoh(struct h1s *h1s, struct h1m *h1m, struct htx *htx, siz
                        char key[29];
 
                        h1_calculate_ws_output_key(h1s->ws_key, key);
-                       if (!h1_format_htx_hdr(ist("Sec-Websocket-Accept"),
+                       if (!h1_format_htx_hdr(ist("sec-websocket-accept"),
                                               ist(key),
                                               &outbuf, hdrs_map)) {
                                goto full;