diff --git a/cmd/api-headers.go b/cmd/api-headers.go index 567bb53e2..a07de1e56 100644 --- a/cmd/api-headers.go +++ b/cmd/api-headers.go @@ -184,12 +184,13 @@ func setObjectHeaders(w http.ResponseWriter, objInfo ObjectInfo, rs *HTTPRangeSp w.Header()[xhttp.AmzBucketReplicationStatus] = []string{objInfo.ReplicationStatus.String()} } + if objInfo.IsRemote() { + // Check if object is being restored. For more information on x-amz-restore header see + // https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html#API_HeadObject_ResponseSyntax + w.Header()[xhttp.AmzStorageClass] = []string{objInfo.TransitionTier} + } + if lc, err := globalLifecycleSys.Get(objInfo.Bucket); err == nil { - if objInfo.IsRemote() { - // Check if object is being restored. For more information on x-amz-restore header see - // https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html#API_HeadObject_ResponseSyntax - w.Header()[xhttp.AmzStorageClass] = []string{objInfo.TransitionTier} - } lc.SetPredictionHeaders(w, objInfo.ToLifecycleOpts()) }