From 1cfb03fb7431d3d530ed0703527f571b49779a5d Mon Sep 17 00:00:00 2001 From: Poorna Date: Tue, 21 Jun 2022 14:11:35 -0700 Subject: [PATCH] replication: Avoid proxying when precondition failed (#15134) Proxying is not required when content is on this cluster and does not meet pre-conditions specified in the request. Fixes #15124 --- cmd/object-handlers.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go index d7d930e00..70f09a6a8 100644 --- a/cmd/object-handlers.go +++ b/cmd/object-handlers.go @@ -420,6 +420,11 @@ func (api objectAPIHandlers) getObjectHandler(ctx context.Context, objectAPI Obj gr, err := getObjectNInfo(ctx, bucket, object, rs, r.Header, readLock, opts) if err != nil { + if isErrPreconditionFailed(err) { + writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL) + return + } + var ( reader *GetObjectReader proxy proxyResult