summaryrefslogtreecommitdiff
path: root/http/http_connection.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-09-06 23:57:30 +0300
committerEd Tanous <ed@tanous.net>2023-12-05 21:54:28 +0300
commit998e0cbdc5092bdaa783d11c2760bf62084403ce (patch)
tree95f8b39cfdbb036d84c7e9f6798dd1a8eb0dd6ec /http/http_connection.hpp
parent4fa45dffd1ece21a468ed32850428b3b41bc8093 (diff)
downloadbmcweb-998e0cbdc5092bdaa783d11c2760bf62084403ce.tar.xz
Fix missing date
At some point, the date got removed from http1 requests. HTTP2 does not show this issue, but this showed up in unit tests (which is why the prior commit is adding unit tests). The Date Header is useful for synchronizing things like Cache-Control-Policy, with the actual server time, instead of the local system time. Tested: Unit tests pass. Change-Id: I8f105f0cbb6c816c5ec6b14cbeae587d728a20d2 Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'http/http_connection.hpp')
-rw-r--r--http/http_connection.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index c64d511925..175912d577 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -364,7 +364,7 @@ class Connection :
res.keepAlive(keepAlive);
completeResponseFields(*req, res);
-
+ res.addHeader(boost::beast::http::field::date, getCachedDateStr());
if (!isAlive())
{
res.setCompleteRequestHandler(nullptr);