From 8e8c3602c6d56270439328eaa122c9fa150e6dc2 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Tue, 13 Feb 2018 18:39:47 +0100 Subject: [PATCH] Allow (websocket) upgrade even without persistent connection for normal http request. (note: this allows to use websocket in single-threaded mode, and avoid the keep-alive-timeout delay before websocket begins its execution) --- .../standalone/src/wgi_standalone_response_stream.e | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_response_stream.e b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_response_stream.e index 40a65e5e..991971a1 100644 --- a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_response_stream.e +++ b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_response_stream.e @@ -110,7 +110,9 @@ feature -- Header output operation if not l_connection.is_case_insensitive_equal_general ("close") then - s.replace_substring ("Connection: close", i + 1, j - 1) + if not l_connection.is_case_insensitive_equal_general ("upgrade") then + s.replace_substring ("Connection: close", i + 1, j - 1) + end end elseif not is_http_version_1_0 then -- HTTP/1.1: always return "close" since persistent connection is not supported.