cleanup: Simplify usage of MinIOSourceProxyRequest (#19553)

This replaces a convoluted condition that ultimately evaluated to

"is this HTTP header present in the request or not?"
This commit is contained in:
Robert Lützner
2024-04-19 12:23:31 +00:00
committed by GitHub
parent 03767d26da
commit 928c0181bf
3 changed files with 6 additions and 12 deletions

View File

@@ -66,13 +66,8 @@ func getDefaultOpts(header http.Header, copySource bool, metadata map[string]str
if crypto.S3.IsRequested(header) || (metadata != nil && crypto.S3.IsEncrypted(metadata)) {
opts.ServerSideEncryption = encrypt.NewSSE()
}
if v, ok := header[xhttp.MinIOSourceProxyRequest]; ok {
opts.ProxyHeaderSet = true
opts.ProxyRequest = strings.Join(v, "") == "true"
}
if _, ok := header[xhttp.MinIOSourceReplicationRequest]; ok {
opts.ReplicationRequest = true
}
_, opts.ProxyRequest = header[xhttp.MinIOSourceProxyRequest]
_, opts.ReplicationRequest = header[xhttp.MinIOSourceReplicationRequest]
opts.Speedtest = header.Get(globalObjectPerfUserMetadata) != ""
return
}