mirror of
https://github.com/minio/minio.git
synced 2025-04-23 11:55:47 -04:00
Fix panic in tagging request proxying (#19032)
This commit is contained in:
parent
53997ecc79
commit
a9cf32811c
@ -2409,8 +2409,7 @@ func proxyTaggingToRepTarget(ctx context.Context, bucket, object string, tags *t
|
|||||||
taggedCount++
|
taggedCount++
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
errCode := minio.ToErrorResponse(err).Code
|
if err != nil {
|
||||||
if errCode != "NoSuchKey" && errCode != "NoSuchVersion" {
|
|
||||||
terr = err
|
terr = err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2470,6 +2469,9 @@ func proxyGetTaggingToRepTarget(ctx context.Context, bucket, object string, opts
|
|||||||
tgs, _ = tags.MapToObjectTags(tagSlc[idx])
|
tgs, _ = tags.MapToObjectTags(tagSlc[idx])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(errs) == 1 {
|
||||||
|
proxy.Err = errs[0]
|
||||||
|
}
|
||||||
return tgs, proxy
|
return tgs, proxy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3317,7 +3317,7 @@ func (api objectAPIHandlers) GetObjectTaggingHandler(w http.ResponseWriter, r *h
|
|||||||
globalReplicationStats.incProxy(bucket, getObjectTaggingAPI, false)
|
globalReplicationStats.incProxy(bucket, getObjectTaggingAPI, false)
|
||||||
// proxy to replication target if site replication is in place.
|
// proxy to replication target if site replication is in place.
|
||||||
tags, gerr := proxyGetTaggingToRepTarget(ctx, bucket, object, opts, proxytgts)
|
tags, gerr := proxyGetTaggingToRepTarget(ctx, bucket, object, opts, proxytgts)
|
||||||
if gerr.Err != nil {
|
if gerr.Err != nil || tags == nil {
|
||||||
globalReplicationStats.incProxy(bucket, getObjectTaggingAPI, true)
|
globalReplicationStats.incProxy(bucket, getObjectTaggingAPI, true)
|
||||||
writeErrorResponse(ctx, w, toAPIError(ctx, gerr.Err), r.URL)
|
writeErrorResponse(ctx, w, toAPIError(ctx, gerr.Err), r.URL)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user