From d62e701918f47b8d3a291e4917d9b379d58351dc Mon Sep 17 00:00:00 2001 From: niksis02 Date: Mon, 31 Mar 2025 14:21:12 +0400 Subject: [PATCH] fix: Changes the HeadObject and GetObject actions LastModified property to UTC Fixes #1137 Changes `LastModified` to `UTC` in the `GetObject` and `HeadObject` actions response. --- s3api/controllers/base.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/s3api/controllers/base.go b/s3api/controllers/base.go index 0d3cab94..c3d52119 100644 --- a/s3api/controllers/base.go +++ b/s3api/controllers/base.go @@ -520,7 +520,7 @@ func (c S3ApiController) GetActions(ctx *fiber.Ctx) error { }, { Key: "Last-Modified", - Value: res.LastModified.Format(timefmt), + Value: res.LastModified.UTC().Format(timefmt), }, }) } @@ -595,7 +595,7 @@ func (c S3ApiController) GetActions(ctx *fiber.Ctx) error { if res.LastModified != nil { hdrs = append(hdrs, utils.CustomHeader{ Key: "Last-Modified", - Value: res.LastModified.Format(timefmt), + Value: res.LastModified.UTC().Format(timefmt), }) } if res.TagCount != nil { @@ -3300,7 +3300,7 @@ func (c S3ApiController) HeadObject(ctx *fiber.Ctx) error { }, { Key: "Last-Modified", - Value: res.LastModified.Format(timefmt), + Value: res.LastModified.UTC().Format(timefmt), }, }) } @@ -3384,7 +3384,7 @@ func (c S3ApiController) HeadObject(ctx *fiber.Ctx) error { }) } if res.LastModified != nil { - lastmod := res.LastModified.Format(timefmt) + lastmod := res.LastModified.UTC().Format(timefmt) headers = append(headers, utils.CustomHeader{ Key: "Last-Modified", Value: lastmod,