Add HTTP field value parsers:

ext_list:
    Iterable container of comma separated extensions, where each extension
    is a token followed an optional list of semicolon delimited parameters,
    with each parameter consisting of a name / value pair. The value can
    be a token or quoted-string.

param_list:
    Iterable container of semicolon delimited parameters, where each parameter
    is a name / value pair. The value can be a token or quoted-string.

token_list
    Iterable container of comma delimited tokens.

* Remove obsolete rfc2616 functions

* Refactor and consolidate case-insensitive string helpers
This commit is contained in:
Vinnie Falco
2016-05-24 06:17:04 -04:00
parent 5a0a47cbae
commit 7e8f5401b2
21 changed files with 1385 additions and 678 deletions

View File

@@ -8,6 +8,8 @@
#ifndef BEAST_HTTP_IMPL_BASIC_HEADERS_IPP
#define BEAST_HTTP_IMPL_BASIC_HEADERS_IPP
#include <beast/http/detail/rfc7230.hpp>
namespace beast {
namespace http {
@@ -257,12 +259,13 @@ template<class Allocator>
void
basic_headers<Allocator>::
insert(boost::string_ref const& name,
boost::string_ref const& value)
boost::string_ref value)
{
value = detail::trim(value);
typename set_t::insert_commit_data d;
auto const result =
set_.insert_check(name, less{}, d);
if (result.second)
if(result.second)
{
auto const p = alloc_traits::allocate(
this->member(), 1);
@@ -284,8 +287,9 @@ template<class Allocator>
void
basic_headers<Allocator>::
replace(boost::string_ref const& name,
boost::string_ref const& value)
boost::string_ref value)
{
value = detail::trim(value);
erase(name);
insert(name, value);
}