From e1c2cee3658bf3ed05ece6cc10f1325ac844e92d Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Tue, 13 Jul 2021 14:22:12 +0300 Subject: [PATCH] [#152] Removed redundant GetBucketInfo call Signed-off-by: Denis Kirillov --- api/handler/put.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/api/handler/put.go b/api/handler/put.go index d4041c8cb..ea9f8462b 100644 --- a/api/handler/put.go +++ b/api/handler/put.go @@ -34,21 +34,6 @@ func (h *handler) PutObjectHandler(w http.ResponseWriter, r *http.Request) { rid = api.GetRequestID(r.Context()) ) - if _, err := h.obj.GetBucketInfo(r.Context(), bkt); err != nil { - h.log.Error("could not find bucket", - zap.String("request_id", rid), - zap.String("bucket_name", bkt), - zap.Error(err)) - - api.WriteErrorResponse(r.Context(), w, api.Error{ - Code: api.GetAPIError(api.ErrBadRequest).Code, - Description: err.Error(), - HTTPStatusCode: http.StatusBadRequest, - }, r.URL) - - return - } - metadata := parseMetadata(r) params := &layer.PutObjectParams{