mirror of
https://github.com/pgsty/minio.git
synced 2026-10-30 04:20:36 +03:00
fix: isolate Snowball replication trust per entry
Evaluate PutObject and ReplicateObject permissions with immutable per-entry request snapshots during concurrent Snowball extraction. Preserve the first API error without sharing mutable handler state, and cover prefix-scoped trust under the race detector. Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
@@ -106,11 +106,9 @@ func hasReplicationRequestHeaders(h http.Header) bool {
|
||||
}
|
||||
|
||||
func cloneRequestWithoutReplicationHeaders(r *http.Request, ctx context.Context) *http.Request {
|
||||
clone := new(http.Request)
|
||||
*clone = *r
|
||||
clone.Header = r.Header.Clone()
|
||||
clone := r.Clone(ctx)
|
||||
stripReplicationRequestHeaders(clone.Header)
|
||||
return clone.WithContext(ctx)
|
||||
return clone
|
||||
}
|
||||
|
||||
// applyReplicationTrust binds the handler context to the effective request.
|
||||
|
||||
Reference in New Issue
Block a user