[#18] Return container name in head-bucket response

Signed-off-by: Artem Tataurov <a.tataurov@yadro.com>
This commit is contained in:
Artem Tataurov 2023-01-30 19:44:28 +03:00 committed by Alex Vanin
parent f9f52ce8e0
commit 5ee4bf80ae
3 changed files with 4 additions and 1 deletions

View file

@ -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

View file

@ -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)
}

View file

@ -63,6 +63,7 @@ const (
AmzServerSideEncryptionCustomerKeyMD5 = "x-amz-server-side-encryption-customer-key-MD5"
ContainerID = "X-Container-Id"
ContainerName = "X-Container-Name"
AccessControlAllowOrigin = "Access-Control-Allow-Origin"
AccessControlAllowMethods = "Access-Control-Allow-Methods"