File indexing completed on 2025-01-18 09:29:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_BEAST_WEBSOCKET_IMPL_RFC6455_HPP
0011 #define BOOST_BEAST_WEBSOCKET_IMPL_RFC6455_HPP
0012
0013 #include <boost/beast/http/fields.hpp>
0014 #include <boost/beast/http/rfc7230.hpp>
0015
0016 namespace boost {
0017 namespace beast {
0018 namespace websocket {
0019
0020 template<class Allocator>
0021 bool
0022 is_upgrade(http::header<true,
0023 http::basic_fields<Allocator>> const& req)
0024 {
0025 if(req.version() < 11)
0026 return false;
0027 if(req.method() != http::verb::get)
0028 return false;
0029 if(! http::token_list{req[http::field::connection]}.exists("upgrade"))
0030 return false;
0031 if(! http::token_list{req[http::field::upgrade]}.exists("websocket"))
0032 return false;
0033 return true;
0034 }
0035
0036 }
0037 }
0038 }
0039
0040 #endif