From 8c3cc96a272d61514d5dc999aeaee2ebbfd1b5fc Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sat, 17 Jun 2017 15:43:55 -0700 Subject: [PATCH] Add message::header_part() --- CHANGELOG.md | 1 + include/beast/http/impl/message.ipp | 3 +-- include/beast/http/message.hpp | 16 +++++++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36ce0255..ddaa6efd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Version 61: * Use generic_cateogry for errno * Reorganize SSL examples * Tidy up some integer conversion warnings +* Add message::header_part() -------------------------------------------------------------------------------- diff --git a/include/beast/http/impl/message.ipp b/include/beast/http/impl/message.ipp index 78b487e0..cd43a277 100644 --- a/include/beast/http/impl/message.ipp +++ b/include/beast/http/impl/message.ipp @@ -300,8 +300,7 @@ void message:: prepare() { - prepare(typename header< - isRequest, Fields>::is_request{}); + prepare(typename header_type::is_request{}); } template diff --git a/include/beast/http/message.hpp b/include/beast/http/message.hpp index b751bcce..e9a1d028 100644 --- a/include/beast/http/message.hpp +++ b/include/beast/http/message.hpp @@ -322,7 +322,7 @@ struct header : Fields */ void reason(string_view s); - + private: #if ! BEAST_DOXYGEN template @@ -469,6 +469,20 @@ struct message : header std::tuple&& body_args, std::tuple&& header_args); + /// Returns the header portion of the message + header_type const& + header_part() const + { + return *this; + } + + /// Returns the header portion of the message + header_type& + header_part() + { + return *this; + } + /// Returns `true` if "close" is specified in the Connection field. bool has_close() const;