forked from boostorg/beast
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.
This commit is contained in:
40
example/server-framework/rfc7231.hpp
Normal file
40
example/server-framework/rfc7231.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// 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
|
||||
Reference in New Issue
Block a user