fix outproxy

This commit is contained in:
Jeff Becker 2016-11-20 12:13:11 -05:00
parent f168e4586c
commit 01da9e3ca2
5 changed files with 109 additions and 77 deletions

View file

@ -259,16 +259,21 @@ namespace http {
return eoh + strlen(HTTP_EOH);
}
std::string HTTPReq::to_string() {
std::stringstream ss;
ss << method << " " << uri << " " << version << CRLF;
void HTTPReq::write(std::ostream & o) {
o << method << " " << uri << " " << version << CRLF;
for (auto & h : headers) {
ss << h.first << ": " << h.second << CRLF;
o << h.first << ": " << h.second << CRLF;
}
ss << CRLF;
return ss.str();
o << CRLF;
}
std::string HTTPReq::to_string()
{
std::stringstream ss;
write(ss);
return ss.str();
}
bool HTTPRes::is_chunked() {
auto it = headers.find("Transfer-Encoding");
if (it == headers.end())