2020-08-19 11:53:17 +00:00
|
|
|
package handler
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2021-05-18 11:10:08 +00:00
|
|
|
"github.com/nspcc-dev/neofs-s3-gw/api"
|
2020-08-19 11:53:17 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (h *handler) GetBucketLocationHandler(w http.ResponseWriter, r *http.Request) {
|
2021-08-05 09:18:52 +00:00
|
|
|
reqInfo := api.GetReqInfo(r.Context())
|
2020-08-19 11:53:17 +00:00
|
|
|
|
2021-08-05 09:18:52 +00:00
|
|
|
if _, err := h.obj.GetBucketInfo(r.Context(), reqInfo.BucketName); err != nil {
|
|
|
|
h.logAndSendError(w, "something went wrong", reqInfo, err)
|
2020-08-19 11:53:17 +00:00
|
|
|
return
|
2021-08-05 09:18:52 +00:00
|
|
|
}
|
2020-10-24 13:09:22 +00:00
|
|
|
|
2021-08-05 09:18:52 +00:00
|
|
|
if err := api.EncodeToResponse(w, LocationResponse{Location: ""}); err != nil {
|
|
|
|
h.logAndSendError(w, "something went wrong", reqInfo, err)
|
2020-08-19 11:53:17 +00:00
|
|
|
}
|
|
|
|
}
|