diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go index fee5903b8..77ecb3cd0 100644 --- a/cmd/object-handlers.go +++ b/cmd/object-handlers.go @@ -1035,6 +1035,10 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re w.Header()[xhttp.AmzDeleteMarker] = []string{strconv.FormatBool(gr.ObjInfo.DeleteMarker)} } } + // Update context bucket & object names for correct S3 XML error response + reqInfo := logger.GetReqInfo(ctx) + reqInfo.BucketName = srcBucket + reqInfo.ObjectName = srcObject writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r)) return }