forked from TrueCloudLab/frostfs-s3-gw
Refactoring api/handler
- don't require token.BearerToken - don't call `GetObjectInfo` Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
This commit is contained in:
parent
58b877b97c
commit
1868034723
2 changed files with 0 additions and 33 deletions
|
@ -30,20 +30,6 @@ func (h *handler) PutObjectHandler(w http.ResponseWriter, r *http.Request) {
|
|||
HTTPStatusCode: http.StatusBadRequest,
|
||||
}, r.URL)
|
||||
|
||||
return
|
||||
} else if _, err = h.obj.GetObjectInfo(r.Context(), bkt, obj); err == nil {
|
||||
h.log.Error("object exists",
|
||||
zap.String("request_id", rid),
|
||||
zap.String("bucket_name", bkt),
|
||||
zap.String("object_name", obj),
|
||||
zap.Error(err))
|
||||
|
||||
api.WriteErrorResponse(r.Context(), w, api.Error{
|
||||
Code: api.GetAPIError(api.ErrMethodNotAllowed).Code,
|
||||
Description: "Object: " + bkt + "#" + obj + " already exists",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
}, r.URL)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue