diff --git a/cmd/api-headers.go b/cmd/api-headers.go index 2a8b2ab04..60cd14f14 100644 --- a/cmd/api-headers.go +++ b/cmd/api-headers.go @@ -199,5 +199,12 @@ func setObjectHeaders(w http.ResponseWriter, objInfo ObjectInfo, rs *HTTPRangeSp lc.SetPredictionHeaders(w, objInfo.ToLifecycleOpts()) } + if v, ok := objInfo.UserDefined[ReservedMetadataPrefix+"compression"]; ok { + if i := strings.LastIndexByte(v, '/'); i >= 0 { + v = v[i+1:] + } + w.Header()[xhttp.MinIOCompressed] = []string{v} + } + return nil } diff --git a/internal/http/headers.go b/internal/http/headers.go index 294dad0df..9b92dd4be 100644 --- a/internal/http/headers.go +++ b/internal/http/headers.go @@ -187,6 +187,9 @@ const ( MinIOSourceObjectLegalHoldTimestamp = "X-Minio-Source-Replication-LegalHold-Timestamp" // predicted date/time of transition MinIOTransition = "X-Minio-Transition" + + // MinIOCompressed is returned when object is compressed + MinIOCompressed = "X-Minio-Compressed" ) // Common http query params S3 API