From 1e9c754091b04993e4ac58d001535fe31135294d Mon Sep 17 00:00:00 2001 From: Ivan Shynkarenka Date: Sat, 23 Dec 2023 14:09:28 +0400 Subject: [PATCH] Fix Bug: .NetFramework 4.8 ClientWebSocket cann't connect WsSession --- include/server/version.h | 2 +- source/server/ws/ws.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/server/version.h b/include/server/version.h index cc282d98..cf6cf015 100644 --- a/include/server/version.h +++ b/include/server/version.h @@ -28,7 +28,7 @@ GitHub: https://github.com/chronoxor/CppServer namespace CppServer { //! Project version -const char version[] = "1.0.4.1"; +const char version[] = "1.0.4.2"; } // namespace CppServer diff --git a/source/server/ws/ws.cpp b/source/server/ws/ws.cpp index 14f60626..46295fef 100644 --- a/source/server/ws/ws.cpp +++ b/source/server/ws/ws.cpp @@ -122,7 +122,7 @@ bool WebSocket::PerformServerUpgrade(const HTTP::HTTPRequest& request, HTTP::HTT if (CppCommon::StringUtils::CompareNoCase(key, "Connection")) { - if (!CppCommon::StringUtils::CompareNoCase(value, "Upgrade") && !CppCommon::StringUtils::CompareNoCase(value, "keep-alive, Upgrade")) + if (!CppCommon::StringUtils::CompareNoCase(value, "Upgrade") && !CppCommon::StringUtils::CompareNoCase(CppCommon::StringUtils::RemoveBlank(value), "keep-alive,Upgrade")) { error = true; response.MakeErrorResponse(400, "Invalid WebSocket handshaked request: 'Connection' header value must be 'Upgrade' or 'keep-alive, Upgrade'");