From bc6140a1eb1e771bdb4ccb803a38155e20395f56 Mon Sep 17 00:00:00 2001 From: ipknHama Date: Sat, 19 Apr 2014 07:27:05 +0900 Subject: added HTTP Date header --- http_connection.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'http_connection.h') 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()); -- cgit v1.2.3-54-g00ecf