diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f389a2..8e86ac4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ This document outlines major changes between releases. ## [Unreleased] ### Added +- Return container name in `head-bucket` response (TrueCloudLab#18) - Billing metrics (TrueCloudLab#5) ### Changed diff --git a/api/handler/head.go b/api/handler/head.go index 2bfce70..0bead4b 100644 --- a/api/handler/head.go +++ b/api/handler/head.go @@ -123,6 +123,7 @@ func (h *handler) HeadBucketHandler(w http.ResponseWriter, r *http.Request) { } w.Header().Set(api.ContainerID, bktInfo.CID.EncodeToString()) + w.Header().Set(api.ContainerName, bktInfo.Name) w.Header().Set(api.AmzBucketRegion, bktInfo.LocationConstraint) api.WriteResponse(w, http.StatusOK, nil, api.MimeNone) } diff --git a/api/headers.go b/api/headers.go index 2e0b9a8..8f5307e 100644 --- a/api/headers.go +++ b/api/headers.go @@ -62,7 +62,8 @@ const ( AmzServerSideEncryptionCustomerKey = "x-amz-server-side-encryption-customer-key" AmzServerSideEncryptionCustomerKeyMD5 = "x-amz-server-side-encryption-customer-key-MD5" - ContainerID = "X-Container-Id" + ContainerID = "X-Container-Id" + ContainerName = "X-Container-Name" AccessControlAllowOrigin = "Access-Control-Allow-Origin" AccessControlAllowMethods = "Access-Control-Allow-Methods"