diff --git a/a8/websocketsession.cc b/a8/websocketsession.cc index 2ba5f8c..2e70d58 100644 --- a/a8/websocketsession.cc +++ b/a8/websocketsession.cc @@ -113,12 +113,10 @@ namespace a8 return; } std::string server_key; - const char* key = WEB_SOCKET_KEY; { char* p1 = strstr(buf + offset, WEB_SOCKET_KEY); if (!p1) { p1 = strstr(buf + offset, WEB_SOCKET_KEY2); - key = WEB_SOCKET_KEY2; } if (p1) { p1 += strlen(WEB_SOCKET_KEY); @@ -136,7 +134,7 @@ namespace a8 std::string response = "HTTP/1.1 101 Web Socket Protocol Handshake\r\n" "Upgrade: websocket\r\n" "Connection: Upgrade\r\n" - + std::string(key) + hash_data + "\r\n" + + "Sec-WebSocket-Accept: " + hash_data + "\r\n" + "\r\n"; SendBuff(response.data(), response.size()); handshook_ = true;