20 #ifndef BEAST_RFC2616_HPP
21 #define BEAST_RFC2616_HPP
23 #include <boost/beast/http/message.hpp>
24 #include <boost/beast/http/rfc7230.hpp>
25 #include <boost/range/algorithm/equal.hpp>
26 #include <boost/range/iterator_range.hpp>
27 #include <boost/utility/string_ref.hpp>
47 return c ==
' ' || c ==
'\t';
67 template <
class FwdIter>
78 }
while (last != first);
82 template <
class String>
110 split(FwdIt first, FwdIt last, Char delim)
112 using namespace detail;
113 using string =
typename Result::value_type;
138 e.append(1, *iter++);
143 e.append(1, *iter++);
148 result.emplace_back(std::move(e));
152 else if (*iter == delim)
157 result.emplace_back(std::move(e));
162 else if (is_lws(*iter))
168 e.append(1, *iter++);
176 result.emplace_back(std::move(e));
188 return split(first, last,
',');
191 template <
class Result = std::vector<std::
string>>
198 template <
bool isRequest,
class Body,
class Fields>
200 is_keep_alive(boost::beast::http::message<isRequest, Body, Fields>
const& m)
202 if (m.version() <= 10)
203 return boost::beast::http::token_list{
204 m[boost::beast::http::field::connection]}
205 .exists(
"keep-alive");
206 return !boost::beast::http::token_list{
207 m[boost::beast::http::field::connection]}