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
This commit is contained in:
Poorna 2022-06-21 14:11:35 -07:00 committed by GitHub
parent f293df647c
commit 1cfb03fb74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -420,6 +420,11 @@ func (api objectAPIHandlers) getObjectHandler(ctx context.Context, objectAPI Obj
gr, err := getObjectNInfo(ctx, bucket, object, rs, r.Header, readLock, opts) gr, err := getObjectNInfo(ctx, bucket, object, rs, r.Header, readLock, opts)
if err != nil { if err != nil {
if isErrPreconditionFailed(err) {
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
return
}
var ( var (
reader *GetObjectReader reader *GetObjectReader
proxy proxyResult proxy proxyResult