From: Josef Schlehofer Date: Tue, 25 Oct 2022 07:40:37 +0000 (+0200) Subject: lighttpd: backport patch to fix dummy Sec-WebSocket-Key X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=de49362d35a4baaa36ca8cab3fa874f3ca8cb6ad;p=feed%2Fpackages.git lighttpd: backport patch to fix dummy Sec-WebSocket-Key It was requested in https://gitlab.nic.cz/turris/os/packages/-/issues/873 Signed-off-by: Josef Schlehofer --- diff --git a/net/lighttpd/patches/010-fix-dummy-Sec-WebSocket-Key-in-proxy_and_cgi.patch b/net/lighttpd/patches/010-fix-dummy-Sec-WebSocket-Key-in-proxy_and_cgi.patch new file mode 100644 index 0000000000..eda27854cd --- /dev/null +++ b/net/lighttpd/patches/010-fix-dummy-Sec-WebSocket-Key-in-proxy_and_cgi.patch @@ -0,0 +1,39 @@ +From cda9b71653bb6a633957f653fa08e819b32e601e Mon Sep 17 00:00:00 2001 +From: Shulyaka +Date: Sun, 23 Oct 2022 13:29:22 +0300 +Subject: [PATCH] [mod_proxy,mod_cgi] fix dummy Sec-WebSocket-Key + +fix dummy Sec-WebSocket-Key value to remove excess '\n' + +x-ref: + "Fix websocket HTTP/2 to HTTP/1.1 proxy" + https://github.com/lighttpd/lighttpd1.4/pull/123 + +github: closes #123 +--- + src/mod_cgi.c | 2 +- + src/mod_proxy.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/src/mod_cgi.c ++++ b/src/mod_cgi.c +@@ -874,7 +874,7 @@ static int cgi_create_env(request_st * c + if (!http_header_request_get(r, HTTP_HEADER_OTHER, + CONST_STR_LEN("Sec-WebSocket-Key"))) + cgi_env_add(env, CONST_STR_LEN("HTTP_SEC_WEBSOCKET_KEY"), +- CONST_STR_LEN("MDAwMDAwMDAwMDAwMDAwMAo=")); ++ CONST_STR_LEN("MDAwMDAwMDAwMDAwMDAwMA==")); + /*(Upgrade and Connection should not exist for HTTP/2 request)*/ + cgi_env_add(env, CONST_STR_LEN("HTTP_UPGRADE"), CONST_STR_LEN("websocket")); + cgi_env_add(env, CONST_STR_LEN("HTTP_CONNECTION"), CONST_STR_LEN("upgrade")); +--- a/src/mod_proxy.c ++++ b/src/mod_proxy.c +@@ -1013,7 +1013,7 @@ static handler_t proxy_create_env(gw_han + if (!http_header_request_get(r, HTTP_HEADER_OTHER, + CONST_STR_LEN("Sec-WebSocket-Key"))) + buffer_append_string_len(b, CONST_STR_LEN( +- "\r\nSec-WebSocket-Key: MDAwMDAwMDAwMDAwMDAwMAo=")); ++ "\r\nSec-WebSocket-Key: MDAwMDAwMDAwMDAwMDAwMA==")); + buffer_append_string_len(b, CONST_STR_LEN( + "\r\nUpgrade: websocket" + "\r\nConnection: close, upgrade\r\n\r\n"));