Refactor header status, reason, and target (API Change):

* header::result is a family of functions to replace header::status

* header interface now uses status enum and also ints

* reason-phrase is no longer stored unless the user explicitly
  requests it.

* When serializing, the standard reason is used for the
  corresponding status code unless the user has changed it.
This commit is contained in:
Vinnie Falco
2017-06-04 17:26:20 -07:00
parent 60f044aff0
commit e67c0abe79
31 changed files with 588 additions and 220 deletions
+2 -23
View File
@@ -230,8 +230,7 @@ erase(string_view name)
template<class Allocator>
void
basic_fields<Allocator>::
insert(string_view name,
string_view value)
insert(string_view name, string_view value)
{
value = detail::trim(value);
auto const p = alloc_traits::allocate(this->member(), 1);
@@ -243,33 +242,13 @@ insert(string_view name,
template<class Allocator>
void
basic_fields<Allocator>::
replace(string_view name,
string_view value)
replace(string_view name, string_view value)
{
value = detail::trim(value);
erase(name);
insert(name, value);
}
template<class Allocator>
string_view
basic_fields<Allocator>::
method_string() const
{
return (*this)[":method"];
}
template<class Allocator>
void
basic_fields<Allocator>::
method_string(string_view s)
{
if(s.empty())
this->erase(":method");
else
this->replace(":method", s);
}
} // http
} // beast