diff --git a/shard.yml b/shard.yml index eb0e903..01c5c8b 100644 --- a/shard.yml +++ b/shard.yml @@ -1,5 +1,5 @@ name: action-controller -version: 7.4.0 +version: 7.4.1 crystal: ">= 1.9.0" dependencies: diff --git a/src/action-controller/base.cr b/src/action-controller/base.cr index 08c96e9..d666125 100644 --- a/src/action-controller/base.cr +++ b/src/action-controller/base.cr @@ -846,7 +846,11 @@ abstract class ActionController::Base end if last_modified - resp_headers["Last-Modified"] = HTTP.format_time(last_modified) + # we need to update this as the HTTP header is less exact + check_time = HTTP.format_time(last_modified) + resp_headers["Last-Modified"] = check_time + last_modified = HTTP.parse_time(check_time).as(Time) + if req_modified = req_headers["If-Modified-Since"]? modified_since = HTTP.parse_time(req_modified) end