Add skip_body parser option

This commit is contained in:
Vinnie Falco
2017-07-20 08:12:07 -07:00
parent 8b71afa63f
commit 344e4c942c
4 changed files with 55 additions and 1 deletions
+13
View File
@@ -61,6 +61,19 @@ public:
expect(m.headers["Server"] == "test");
expect(m.body == "*");
}
// skip body
{
error_code ec;
parser_v1<false, string_body, headers> p;
std::string const s =
"HTTP/1.1 200 Connection Established\r\n"
"Proxy-Agent: Zscaler/5.1\r\n"
"\r\n";
p.set_option(skip_body{true});
p.write(buffer(s), ec);
expect(! ec);
expect(p.complete());
}
}
};