Derive header from Fields (API Change)

This commit is contained in:
Vinnie Falco
2017-07-20 08:12:18 -07:00
parent 5f2e7560b6
commit 2af19481a9
35 changed files with 304 additions and 298 deletions
+7 -7
View File
@@ -66,11 +66,11 @@ public:
[&](yield_context)
{
flat_buffer buffer;
request<string_body, fields> req;
request<string_body> req;
req.version = 11;
req.method("POST");
req.target("/");
req.fields.insert("User-Agent", "test");
req.insert("User-Agent", "test");
req.body = "Hello, world!";
prepare(req);
@@ -99,11 +99,11 @@ public:
void
doRelay()
{
request<string_body, fields> req;
request<string_body> req;
req.version = 11;
req.method("POST");
req.target("/");
req.fields.insert("User-Agent", "test");
req.insert("User-Agent", "test");
req.body = "Hello, world!";
prepare(req);
@@ -121,8 +121,8 @@ public:
relay<true>(upstream.client, downstream.server, buffer, ec,
[&](header<true, fields>& h, error_code& ec)
{
h.fields.erase("Content-Length");
h.fields.replace("Transfer-Encoding", "chunked");
h.erase("Content-Length");
h.replace("Transfer-Encoding", "chunked");
});
BEAST_EXPECTS(! ec, ec.message());
BEAST_EXPECT(equal_body<true>(
@@ -155,7 +155,7 @@ public:
req.version = 11;
req.method(verb::get);
req.target("/");
req.fields.insert("User-Agent", "test");
req.insert("User-Agent", "test");
error_code ec;
write_ostream(os, req, ec);
BEAST_EXPECTS(! ec, ec.message());