forked from TrueCloudLab/frostfs-s3-gw
[#656] Read full body on upload error
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
9590b39333
commit
44d5878a80
1 changed files with 3 additions and 1 deletions
|
@ -248,7 +248,9 @@ func (h *handler) PutObjectHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
info, err := h.obj.PutObject(r.Context(), params)
|
info, err := h.obj.PutObject(r.Context(), params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
h.logAndSendError(w, "could not upload object", reqInfo, err)
|
_, err2 := io.Copy(io.Discard, r.Body)
|
||||||
|
err3 := r.Body.Close()
|
||||||
|
h.logAndSendError(w, "could not upload object", reqInfo, err, zap.Errors("body close errors", []error{err2, err3}))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue