解决有的谷歌浏览器连接不上websocket服务器的问题

This commit is contained in:
luoliangyi 2022-08-05 16:46:07 +08:00
parent 52982cd5f4
commit 669522e203
1 changed files with 6 additions and 4 deletions

View File

@ -953,10 +953,12 @@ namespace ver_2
HttpHead::AnalysisHead(head, requestMethod, requestURIPath, requestURIQueryInfos,
requestURIFragment, httpVersion, headInfos);
if (std::string::npos == HttpHead::GetValue(headInfos, "Connection").find("Upgrade"))
return false;
if ("websocket" != HttpHead::GetValue(headInfos, "Upgrade"))
return false;
HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, head.c_str());
//if (std::string::npos == HttpHead::GetValue(headInfos, "Connection").find("Upgrade"))
// return false;
//if ("websocket" != HttpHead::GetValue(headInfos, "Upgrade"))
// return false;
std::string key = HttpHead::GetValue(headInfos, "Sec-WebSocket-Key");
if (key.empty())