forked from TrueCloudLab/frostfs-s3-gw
[#220] Add cid to HeadBucket response
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
76fc241bc1
commit
84508a1706
2 changed files with 5 additions and 1 deletions
|
@ -54,10 +54,12 @@ func (h *handler) HeadObjectHandler(w http.ResponseWriter, r *http.Request) {
|
|||
func (h *handler) HeadBucketHandler(w http.ResponseWriter, r *http.Request) {
|
||||
reqInfo := api.GetReqInfo(r.Context())
|
||||
|
||||
if _, err := h.obj.GetBucketInfo(r.Context(), reqInfo.BucketName); err != nil {
|
||||
bktInfo, err := h.obj.GetBucketInfo(r.Context(), reqInfo.BucketName)
|
||||
if err != nil {
|
||||
h.logAndSendError(w, "could not fetch object info", reqInfo, err)
|
||||
return
|
||||
}
|
||||
|
||||
w.Header().Set(api.ContainerID, bktInfo.CID.String())
|
||||
api.WriteResponse(w, http.StatusOK, nil, api.MimeNone)
|
||||
}
|
||||
|
|
|
@ -39,4 +39,6 @@ const (
|
|||
AmzGrantRead = "X-Amz-Grant-Read"
|
||||
AmzGrantWrite = "X-Amz-Grant-Write"
|
||||
AmzExpectedBucketOwner = "X-Amz-Expected-Bucket-Owner"
|
||||
|
||||
ContainerID = "X-Container-Id"
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue