Commit 791f2ea9 authored by Mathieu Stefani's avatar Mathieu Stefani

Headers do not write their names anymore

parent 7cefb695
......@@ -372,10 +372,11 @@ Response::writeTo(Tcp::Peer& peer)
stream << "HTTP/1.1 ";
stream << code_;
stream << ' ';
stream << codeString(static_cast<Code>(code_));
stream << static_cast<Code>(code_);
stream << crlf;
for (const auto& header: headers.list()) {
stream << header->name() << ": ";
header->write(stream);
stream << crlf;
}
......
......@@ -243,7 +243,7 @@ ContentLength::parse(const std::string& data) {
void
ContentLength::write(std::ostream& os) const {
os << "Content-Length: " << value_;
os << value_;
}
void
......@@ -276,7 +276,7 @@ UserAgent::parse(const std::string& data) {
void
UserAgent::write(std::ostream& os) const {
os << "User-Agent: " << ua_;
os << ua_;
}
void
......@@ -340,7 +340,7 @@ ContentEncoding::parseRaw(const char* str, size_t len) {
void
ContentEncoding::write(std::ostream& os) const {
os << "Content-Encoding: " << encodingString(encoding_);
os << encodingString(encoding_);
}
Server::Server(const std::vector<std::string>& tokens)
......@@ -365,7 +365,6 @@ Server::parse(const std::string& data)
void
Server::write(std::ostream& os) const
{
os << "Server: ";
std::copy(std::begin(tokens_), std::end(tokens_),
std::ostream_iterator<std::string>(os, " "));
}
......@@ -378,7 +377,6 @@ ContentType::parseRaw(const char* str, size_t len)
void
ContentType::write(std::ostream& os) const {
os << "Content-Type: ";
os << mime_.toString();
}
......
Markdown is supported
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