You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.1 KiB

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