diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-01-02 23:51:52 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-01-02 23:51:52 +0100 |
commit | 4188dfb5d3e5e41a812d4e6cdbfca053b0cbd62b (patch) | |
tree | 59c6bbea92744328c5de9d7df1b5ec8cd8dd7272 | |
parent | ea754365e607c7c36d00909ea7605daeaa64243c (diff) |
Cast strings to std::string to avoid sending null-bytes in write_headers().
-rw-r--r-- | http_connection.cpp | 4 |
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"))); } |