Make WebSocket suitable for Firefox browser
This commit is contained in:
parent
524ad6ce22
commit
66c518949d
|
@ -103,7 +103,10 @@ static bool parseWebsockMessage(MsgBuffer *buffer, std::string &message)
|
||||||
|
|
||||||
static bool isWebSocket(const HttpRequestImplPtr &req)
|
static bool isWebSocket(const HttpRequestImplPtr &req)
|
||||||
{
|
{
|
||||||
if (req->getHeaderBy("connection") == "Upgrade" &&
|
auto &headers = req->headers();
|
||||||
|
if (headers.find("upgrade") == headers.end() || headers.find("connection") == headers.end())
|
||||||
|
return false;
|
||||||
|
if (req->getHeaderBy("connection").find("Upgrade") != std::string::npos &&
|
||||||
req->getHeaderBy("upgrade") == "websocket")
|
req->getHeaderBy("upgrade") == "websocket")
|
||||||
{
|
{
|
||||||
LOG_TRACE << "new websocket request";
|
LOG_TRACE << "new websocket request";
|
||||||
|
|
Loading…
Reference in New Issue