File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -614,6 +614,21 @@ void server<endpoint>::connection<connection_type>::handle_read_request(
614614 }
615615
616616 m_connection.m_processor ->validate_handshake (m_request);
617+
618+ // Extract subprotocols
619+ std::string subprotocols = m_request.header (" Sec-WebSocket-Protocol" );
620+ if (subprotocols.length () > 0 ) {
621+ boost::char_separator<char > sep (" ," );
622+ boost::tokenizer< boost::char_separator<char > > tokens (subprotocols, sep);
623+ for (boost::tokenizer< boost::char_separator<char > >::iterator it = tokens.begin (); it != tokens.end (); ++it){
624+ std::string proto = *it;
625+ boost::trim (proto);
626+ if (proto.length () > 0 ){
627+ m_requested_subprotocols.push_back (proto);
628+ }
629+ }
630+ }
631+
617632 m_origin = m_connection.m_processor ->get_origin (m_request);
618633 m_uri = m_connection.m_processor ->get_uri (m_request);
619634
You can’t perform that action at this time.
0 commit comments