summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-01-02 23:51:52 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2011-01-02 23:51:52 +0100
commit4188dfb5d3e5e41a812d4e6cdbfca053b0cbd62b (patch)
tree59c6bbea92744328c5de9d7df1b5ec8cd8dd7272
parentea754365e607c7c36d00909ea7605daeaa64243c (diff)
Cast strings to std::string to avoid sending null-bytes in write_headers().
-rw-r--r--http_connection.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/http_connection.cpp b/http_connection.cpp
index 6e970b2..ff7e795 100644
--- a/http_connection.cpp
+++ b/http_connection.cpp
@@ -91,11 +91,11 @@ void HTTP::Connection::write_headers() {
}
headers_written = true;
- boost::asio::write(socket, boost::asio::buffer("HTTP/1.1 200 OK\r\n"));
+ boost::asio::write(socket, boost::asio::buffer(std::string("HTTP/1.1 200 OK\r\n")));
for(HeaderList::iterator it = response_headers.begin(); it != response_headers.end(); it++) {
boost::asio::write(socket, boost::asio::buffer(boost::str(boost::format("%s: %s\r\n") % it->first % it->second)));
}
- boost::asio::write(socket, boost::asio::buffer("\r\n"));
+ boost::asio::write(socket, boost::asio::buffer(std::string("\r\n")));
}