Add skip_body parser option

This commit is contained in:
Vinnie Falco
2016-06-15 11:52:59 -04:00
parent 69da298aa7
commit 8375ae647e
4 changed files with 55 additions and 1 deletions

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());
}
}
};