File tree Expand file tree Collapse file tree 2 files changed +4
-47
lines changed Expand file tree Collapse file tree 2 files changed +4
-47
lines changed Original file line number Diff line number Diff line change @@ -111,21 +111,23 @@ namespace xwebsocket
111
111
{
112
112
using cmper = xutil::functional::strncasecmper;
113
113
make_handshake_ = true ;
114
+ path_ = http_parser_.url ();
115
+
114
116
auto upgrade = http_parser_.get_header <cmper>(" Upgrade" );
115
117
auto Sec_WebSocket_Key = http_parser_.get_header <cmper>(" Sec-WebSocket-Key" );
116
118
auto Sec_WebSocket_Protocol = http_parser_.get_header <cmper>(" Sec-WebSocket-Protocol" );
119
+
117
120
if (!xutil::functional::strcasecmper ()(upgrade.c_str (), " websocket" )||
118
121
Sec_WebSocket_Key.empty ())
119
122
{
120
123
http_buider_.set_status (404 );
121
124
send_data (http_buider_.build_resp ());
122
125
on_close ();
123
126
}
127
+
124
128
send_data (make_handshake (Sec_WebSocket_Key, Sec_WebSocket_Protocol));
125
- path_ = http_parser_.path ();
126
129
127
130
auto buffer = http_parser_.get_string ();
128
-
129
131
if (buffer.size ())
130
132
return recv_callback ((char *)buffer.c_str (), buffer.size ());
131
133
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments