aboutsummaryrefslogtreecommitdiffstats
path: root/http_connection.h
diff options
context:
space:
mode:
authoripknHama <ipknhama@gmail.com>2014-04-19 07:27:05 +0900
committeripknHama <ipknhama@gmail.com>2014-04-19 07:27:05 +0900
commitbc6140a1eb1e771bdb4ccb803a38155e20395f56 (patch)
treeb95a349850edc5ec6b073456a119f215cafa03bd /http_connection.h
parentde7a70de347c33ece5b25379c366b2c49418df08 (diff)
downloadcrow-bc6140a1eb1e771bdb4ccb803a38155e20395f56.tar.gz
crow-bc6140a1eb1e771bdb4ccb803a38155e20395f56.zip
added HTTP Date header
Diffstat (limited to 'http_connection.h')
-rw-r--r--http_connection.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/http_connection.h b/http_connection.h
index 9166fb4..7c4da26 100644
--- a/http_connection.h
+++ b/http_connection.h
@@ -9,6 +9,7 @@
#include "parser.h"
#include "http_response.h"
+#include "datetime.h"
namespace flask
{
@@ -112,6 +113,12 @@ namespace flask
}
if (!has_date)
{
+ std::string date_str = DateTime().str();
+ auto ret = res.headers.emplace("Date", date_str);
+ buffers_.emplace_back(ret.first->first.data(), ret.first->first.size());
+ buffers_.emplace_back(seperator.data(), seperator.size());
+ buffers_.emplace_back(ret.first->second.data(), ret.first->second.size());
+ buffers_.emplace_back(crlf.data(), crlf.size());
}
buffers_.emplace_back(crlf.data(), crlf.size());