From 998e0cbdc5092bdaa783d11c2760bf62084403ce Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Wed, 6 Sep 2023 13:57:30 -0700 Subject: 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 --- http/http_connection.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'http/http_connection.hpp') 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); -- cgit v1.2.3