write headers to the response

This commit is contained in:
Benjamin Sergeant 2019-06-20 19:27:12 -07:00
parent 74cc6b815a
commit 15fa328a65

View File

@ -116,6 +116,10 @@ namespace ix
// Write headers // Write headers
ss.str(""); ss.str("");
ss << "Content-Length: " << response->payload.size() << "\r\n"; ss << "Content-Length: " << response->payload.size() << "\r\n";
for (auto&& it : response->headers)
{
ss << it.first << ": " << it.second << "\r\n";
}
ss << "\r\n"; ss << "\r\n";
if (!socket->writeBytes(ss.str(), nullptr)) if (!socket->writeBytes(ss.str(), nullptr))