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

@@ -97,10 +97,10 @@ struct write_preparation
message_v1<isRequest, Body, Headers> const& msg_)
: msg(msg_)
, w(msg)
, chunked(rfc2616::token_in_list(
msg.headers["Transfer-Encoding"], "chunked"))
, close(rfc2616::token_in_list(
msg.headers["Connection"], "close") ||
, chunked(token_list{
msg.headers["Transfer-Encoding"]}.exists("chunked"))
, close(token_list{
msg.headers["Connection"]}.exists("close") ||
(msg.version < 11 && ! msg.headers.exists(
"Content-Length")))
{