diff --git a/api/handler/copy.go b/api/handler/copy.go index 897f585df..0d08a0714 100644 --- a/api/handler/copy.go +++ b/api/handler/copy.go @@ -111,7 +111,7 @@ func (h *handler) CopyObjectHandler(w http.ResponseWriter, r *http.Request) { if info, err = h.obj.CopyObject(r.Context(), params); err != nil { h.logAndSendError(w, "couldn't copy object", reqInfo, err, additional...) return - } else if err = api.EncodeToResponse(w, &CopyObjectResponse{LastModified: info.Created.Format(time.RFC3339), ETag: info.HashSum}); err != nil { + } else if err = api.EncodeToResponse(w, &CopyObjectResponse{LastModified: info.Created.UTC().Format(time.RFC3339), ETag: info.HashSum}); err != nil { h.logAndSendError(w, "something went wrong", reqInfo, err, additional...) return } diff --git a/api/handler/list.go b/api/handler/list.go index 4a7ade7f5..1d02ea0f9 100644 --- a/api/handler/list.go +++ b/api/handler/list.go @@ -38,7 +38,7 @@ func (h *handler) ListBucketsHandler(w http.ResponseWriter, r *http.Request) { for _, item := range list { res.Buckets.Buckets = append(res.Buckets.Buckets, Bucket{ Name: item.Name, - CreationDate: item.Created.Format(time.RFC3339), + CreationDate: item.Created.UTC().Format(time.RFC3339), }) } diff --git a/api/handler/multipart_upload.go b/api/handler/multipart_upload.go index cb466b106..f96623b1b 100644 --- a/api/handler/multipart_upload.go +++ b/api/handler/multipart_upload.go @@ -342,7 +342,7 @@ func (h *handler) UploadPartCopy(w http.ResponseWriter, r *http.Request) { response := UploadPartCopyResponse{ ETag: info.HashSum, - LastModified: info.Created.Format(time.RFC3339), + LastModified: info.Created.UTC().Format(time.RFC3339), } if err = api.EncodeToResponse(w, response); err != nil { @@ -636,7 +636,7 @@ func encodeListMultipartUploadsToResponse(info *layer.ListMultipartUploadsInfo, uploads := make([]MultipartUpload, 0, len(info.Uploads)) for _, u := range info.Uploads { m := MultipartUpload{ - Initiated: u.Created.Format(time.RFC3339), + Initiated: u.Created.UTC().Format(time.RFC3339), Initiator: Initiator{ ID: u.Owner.String(), DisplayName: u.Owner.String(), diff --git a/api/handler/object_list.go b/api/handler/object_list.go index d061b8259..28ebf9b19 100644 --- a/api/handler/object_list.go +++ b/api/handler/object_list.go @@ -194,7 +194,7 @@ func fillContents(src []*data.ObjectInfo, encode string, fetchOwner bool) []Obje res := Object{ Key: s3PathEncode(obj.Name, encode), Size: obj.Size, - LastModified: obj.Created.Format(time.RFC3339), + LastModified: obj.Created.UTC().Format(time.RFC3339), ETag: obj.HashSum, } @@ -281,7 +281,7 @@ func encodeListObjectVersionsToResponse(info *layer.ListObjectVersionsInfo, buck res.Version = append(res.Version, ObjectVersionResponse{ IsLatest: ver.IsLatest, Key: ver.Object.Name, - LastModified: ver.Object.Created.Format(time.RFC3339), + LastModified: ver.Object.Created.UTC().Format(time.RFC3339), Owner: Owner{ ID: ver.Object.Owner.String(), DisplayName: ver.Object.Owner.String(), @@ -296,7 +296,7 @@ func encodeListObjectVersionsToResponse(info *layer.ListObjectVersionsInfo, buck res.DeleteMarker = append(res.DeleteMarker, DeleteMarkerEntry{ IsLatest: del.IsLatest, Key: del.Object.Name, - LastModified: del.Object.Created.Format(time.RFC3339), + LastModified: del.Object.Created.UTC().Format(time.RFC3339), Owner: Owner{ ID: del.Object.Owner.String(), DisplayName: del.Object.Owner.String(), diff --git a/api/layer/multipart_upload.go b/api/layer/multipart_upload.go index 18b1b1e1c..cb0d767a2 100644 --- a/api/layer/multipart_upload.go +++ b/api/layer/multipart_upload.go @@ -404,7 +404,7 @@ func (n *layer) ListParts(ctx context.Context, p *ListPartsParams) (*ListPartsIn } parts = append(parts, &Part{ ETag: objInfo.HashSum, - LastModified: objInfo.Created.Format(time.RFC3339), + LastModified: objInfo.Created.UTC().Format(time.RFC3339), PartNumber: num, Size: objInfo.Size, })