diff --git a/ZLToolKit b/ZLToolKit index 4ecfcd8f..05a3600d 160000 --- a/ZLToolKit +++ b/ZLToolKit @@ -1 +1 @@ -Subproject commit 4ecfcd8fa0cd500156b7de9f37cd9673778c379b +Subproject commit 05a3600db674410c7930e169046b272fd1c3cccd diff --git a/src/Http/HttpSession.cpp b/src/Http/HttpSession.cpp index 180bbb59..57deda8f 100644 --- a/src/Http/HttpSession.cpp +++ b/src/Http/HttpSession.cpp @@ -185,11 +185,10 @@ void HttpSession::onManager() { inline bool HttpSession::checkWebSocket(){ - if(m_parser["Connection"] != "Upgrade" || - m_parser["Upgrade"] != "websocket" ){ + auto Sec_WebSocket_Key = m_parser["Sec-WebSocket-Key"]; + if(Sec_WebSocket_Key.empty()){ return false; } - auto Sec_WebSocket_Key = m_parser["Sec-WebSocket-Key"]; auto Sec_WebSocket_Accept = encodeBase64(SHA1::encode_bin(Sec_WebSocket_Key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")); KeyValue headerOut;