forked from TrueCloudLab/frostfs-s3-gw
Alex Vanin
813aa2f173
Due to source code relocation from GitHub. Signed-off-by: Alex Vanin <a.vanin@yadro.com>
21 lines
570 B
Go
21 lines
570 B
Go
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api"
|
|
)
|
|
|
|
func (h *handler) GetBucketLocationHandler(w http.ResponseWriter, r *http.Request) {
|
|
reqInfo := api.GetReqInfo(r.Context())
|
|
|
|
bktInfo, err := h.getBucketAndCheckOwner(r, reqInfo.BucketName)
|
|
if err != nil {
|
|
h.logAndSendError(w, "could not get bucket info", reqInfo, err)
|
|
return
|
|
}
|
|
|
|
if err = api.EncodeToResponse(w, LocationResponse{Location: bktInfo.LocationConstraint}); err != nil {
|
|
h.logAndSendError(w, "couldn't encode bucket location response", reqInfo, err)
|
|
}
|
|
}
|