packages/net/lighttpd/patches/030-101-upgrade-w-content-length.patch
Glenn Strauss 52f85a0e1f lighttpd: patches from upstream
- ignore Content-Length from backend if 101 Switching Protocols
- close HTTP/2 connection after bad password
- skip cert chain build for self-issued certs
- meson zstd fix
- ls-hpack upstream update
- discard some HTTP/2 DATA frames received after response

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
2021-04-23 22:12:59 -04:00

31 lines
1.1 KiB
Diff

From 1ca25d4e2cfeb83c844ad52b9c94eac218c71379 Mon Sep 17 00:00:00 2001
From: Glenn Strauss <gstrauss@gluelogic.com>
Date: Thu, 4 Feb 2021 00:22:12 -0500
Subject: [PATCH] [core] 101 upgrade fails if Content-Length incl (fixes #3063)
(thx daimh)
commit 903024d7 in lighttpd 1.4.57 fixed issue #3046 but in the process
broke HTTP/1.1 101 Switching Protocols which included Content-Length: 0
in the response headers. Content-Length response header is permitted
by the RFCs, but not necessary with HTTP status 101 Switching Protocols.
x-ref:
"websocket proxy fails if 101 Switching Protocols from backend includes Content-Length"
https://redmine.lighttpd.net/issues/3063
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
---
src/http-header-glue.c | 1 +
1 file changed, 1 insertion(+)
--- a/src/http-header-glue.c
+++ b/src/http-header-glue.c
@@ -961,6 +961,7 @@ void http_response_upgrade_read_body_unk
(FDEVENT_STREAM_RESPONSE_BUFMIN | FDEVENT_STREAM_RESPONSE);
r->conf.stream_request_body |= FDEVENT_STREAM_REQUEST_POLLIN;
r->reqbody_length = -2;
+ r->resp_body_scratchpad = -1;
r->keep_alive = 0;
}