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)
This commit is contained in:
2018-02-13 18:39:47 +01:00
parent ffd7dd8540
commit 8e8c3602c6

View File

@@ -110,8 +110,10 @@ feature -- Header output operation
if if
not l_connection.is_case_insensitive_equal_general ("close") not l_connection.is_case_insensitive_equal_general ("close")
then then
if not l_connection.is_case_insensitive_equal_general ("upgrade") then
s.replace_substring ("Connection: close", i + 1, j - 1) s.replace_substring ("Connection: close", i + 1, j - 1)
end end
end
elseif not is_http_version_1_0 then elseif not is_http_version_1_0 then
-- HTTP/1.1: always return "close" since persistent connection is not supported. -- HTTP/1.1: always return "close" since persistent connection is not supported.
s.append ("Connection: close") s.append ("Connection: close")