From 9fdf05bed06ef10b260d2e9d77761da211e89208 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 29 Sep 2018 11:08:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dwebsock=E8=AF=AF=E5=88=A4?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZLToolKit | 2 +- src/Http/HttpSession.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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;