forked from TrueCloudLab/frostfs-s3-gw
Merge pull request #224 from KirillovDenis/feature/220-add_cid_to_head_bucket_response
[#220] Add cid to HeadBucket response
This commit is contained in:
commit
68e4e1bbc3
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) {
|
func (h *handler) HeadBucketHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
reqInfo := api.GetReqInfo(r.Context())
|
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)
|
h.logAndSendError(w, "could not fetch object info", reqInfo, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w.Header().Set(api.ContainerID, bktInfo.CID.String())
|
||||||
api.WriteResponse(w, http.StatusOK, nil, api.MimeNone)
|
api.WriteResponse(w, http.StatusOK, nil, api.MimeNone)
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,4 +39,6 @@ const (
|
||||||
AmzGrantRead = "X-Amz-Grant-Read"
|
AmzGrantRead = "X-Amz-Grant-Read"
|
||||||
AmzGrantWrite = "X-Amz-Grant-Write"
|
AmzGrantWrite = "X-Amz-Grant-Write"
|
||||||
AmzExpectedBucketOwner = "X-Amz-Expected-Bucket-Owner"
|
AmzExpectedBucketOwner = "X-Amz-Expected-Bucket-Owner"
|
||||||
|
|
||||||
|
ContainerID = "X-Container-Id"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue