forked from boostorg/beast
Remove HTTP header aliases (API Change):
fix #382 * request_header and response_header are removed
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
namespace beast {
|
||||
namespace http {
|
||||
|
||||
#if BEAST_DOXYGEN
|
||||
/** A container for a HTTP request or response header.
|
||||
|
||||
A header includes the Start Line and Fields.
|
||||
@@ -33,11 +32,12 @@ namespace http {
|
||||
|
||||
@li Invoke algorithms which operate on the header only.
|
||||
*/
|
||||
template<bool isRequest, class Fields>
|
||||
#if BEAST_DOXYGEN
|
||||
template<bool isRequest, class Fields = fields>
|
||||
struct header
|
||||
|
||||
#else
|
||||
template<bool isRequest, class Fields>
|
||||
template<bool isRequest, class Fields = fields>
|
||||
struct header;
|
||||
|
||||
template<class Fields>
|
||||
@@ -285,7 +285,7 @@ struct header<false, Fields>
|
||||
@tparam Fields The type of container used to hold the
|
||||
field value pairs.
|
||||
*/
|
||||
template<bool isRequest, class Body, class Fields>
|
||||
template<bool isRequest, class Body, class Fields = fields>
|
||||
struct message : header<isRequest, Fields>
|
||||
{
|
||||
/// The base class used to hold the header portion of the message.
|
||||
@@ -442,6 +442,14 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
/// A typical HTTP request
|
||||
template<class Body, class Fields = fields>
|
||||
using request = message<true, Body, Fields>;
|
||||
|
||||
/// A typical HTTP response
|
||||
template<class Body, class Fields = fields>
|
||||
using response = message<false, Body, Fields>;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if BEAST_DOXYGEN
|
||||
@@ -468,20 +476,6 @@ swap(
|
||||
message<isRequest, Body, Fields>& m1,
|
||||
message<isRequest, Body, Fields>& m2);
|
||||
|
||||
/// A typical HTTP request header
|
||||
using request_header = header<true, fields>;
|
||||
|
||||
/// Typical HTTP response header
|
||||
using response_header = header<false, fields>;
|
||||
|
||||
/// A typical HTTP request
|
||||
template<class Body, class Fields = fields>
|
||||
using request = message<true, Body, Fields>;
|
||||
|
||||
/// A typical HTTP response
|
||||
template<class Body, class Fields = fields>
|
||||
using response = message<false, Body, Fields>;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Returns `true` if the HTTP/1 message indicates a keep alive.
|
||||
|
||||
@@ -39,7 +39,7 @@ class stream<NextLayer>::response_op
|
||||
{
|
||||
bool cont;
|
||||
stream<NextLayer>& ws;
|
||||
http::response_header res;
|
||||
http::header<false, http::fields> res;
|
||||
int state = 0;
|
||||
|
||||
template<class Fields, class Decorator>
|
||||
|
||||
@@ -282,7 +282,7 @@ build_response(request_type const& req,
|
||||
template<class NextLayer>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
do_response(http::response_header const& res,
|
||||
do_response(http::header<false> const& res,
|
||||
detail::sec_ws_key_type const& key, error_code& ec)
|
||||
{
|
||||
bool const success = [&]()
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace beast {
|
||||
namespace websocket {
|
||||
|
||||
/// The type of object holding HTTP Upgrade requests
|
||||
using request_type = http::request_header;
|
||||
using request_type = http::header<true, http::fields>;
|
||||
|
||||
/// The type of object holding HTTP Upgrade responses
|
||||
using response_type =
|
||||
@@ -2981,7 +2981,7 @@ private:
|
||||
Decorator const& decorator);
|
||||
|
||||
void
|
||||
do_response(http::response_header const& resp,
|
||||
do_response(http::header<false> const& resp,
|
||||
detail::sec_ws_key_type const& key, error_code& ec);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user