Commit 0d01ae64 authored by i404788's avatar i404788
Browse files

WIP

parent cb3af892
......@@ -53,7 +53,7 @@ void Response::Redirect(const std::string& location)
SetHeader("Location", location);
}
std::unique_ptr<std::istream> Response::ConstructHeader()
void Response::ConstructHeader(std::ostream& os)
{
// Date header
std::time_t t = std::time(nullptr);
......@@ -87,17 +87,14 @@ std::unique_ptr<std::istream> Response::ConstructHeader()
reason = reasonOverride;
}
auto header = std::make_unique<std::stringstream>();
*header << "HTTP/1.1 " << status << " " << reason << "\r\n";
os << "HTTP/1.1 " << status << " " << reason << "\r\n";
for (auto&& i : headers)
{
*header << i.first << ": " << i.second << "\r\n";
os << i.first << ": " << i.second << "\r\n";
}
*header << "\r\n";
return header;
os << "\r\n";
}
std::unique_ptr<std::istream> Response::ConstructChunked()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment