Files
boost_beast/example/server-framework/rfc7231.hpp
Vinnie Falco fd9a13b11f New server-framework, full featured server example:
A new server framework is introduced, allowing users to
quickly get off the ground. Example servers are refactored
to use the common framework.
2017-07-20 08:15:26 -07:00

41 lines
973 B
C++

//
// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BEAST_EXAMPLE_SERVER_RFC7231_HPP
#define BEAST_EXAMPLE_SERVER_RFC7231_HPP
#include <beast/core/string.hpp>
#include <beast/http/message.hpp>
namespace framework {
namespace rfc7231 {
// This aggregates a collection of algorithms
// corresponding to specifications in rfc7231:
//
// https://tools.ietf.org/html/rfc7231
//
/** Returns `true` if the message specifies Expect: 100-continue
@param req The request to check
@see https://tools.ietf.org/html/rfc7231#section-5.1.1
*/
template<class Body, class Fields>
bool
is_expect_100_continue(beast::http::request<Body, Fields> const& req)
{
return beast::iequals(
req[beast::http::field::expect], "100-continue");
}
} // rfc7231
} // framework
#endif