diff --git a/api/handler/get.go b/api/handler/get.go index 1a910a009..5452504f4 100644 --- a/api/handler/get.go +++ b/api/handler/get.go @@ -85,6 +85,13 @@ func writeHeaders(h http.Header, info *data.ObjectInfo, tagSetLength int) { h.Set(api.AmzVersionID, info.ID.String()) h.Set(api.AmzTaggingCount, strconv.Itoa(tagSetLength)) + if cacheControl := info.Headers[api.CacheControl]; cacheControl != "" { + h.Set(api.CacheControl, cacheControl) + } + if expires := info.Headers[api.Expires]; expires != "" { + h.Set(api.Expires, expires) + } + for key, val := range info.Headers { if layer.IsSystemHeader(key) { continue diff --git a/api/handler/put.go b/api/handler/put.go index 0bd1f6097..44b7b5056 100644 --- a/api/handler/put.go +++ b/api/handler/put.go @@ -194,6 +194,12 @@ func (h *handler) PutObjectHandler(w http.ResponseWriter, r *http.Request) { if contentType := r.Header.Get(api.ContentType); len(contentType) > 0 { metadata[api.ContentType] = contentType } + if cacheControl := r.Header.Get(api.CacheControl); len(cacheControl) > 0 { + metadata[api.CacheControl] = cacheControl + } + if expires := r.Header.Get(api.Expires); len(expires) > 0 { + metadata[api.Expires] = expires + } params := &layer.PutObjectParams{ Bucket: reqInfo.BucketName,