mirror of
https://github.com/pgsty/minio.git
synced 2026-03-16 17:53:43 +01:00
Preserve ETag case for S3 compatibility (#7498)
Most hadoop distributions hortonworks, cloudera all depend on aws-sdk-java 1.7.x to 1.10.x - the releases which have bugs related case sensitive check for ETag header. Go changes the case of the headers set to be canonical but only preserves them when set through a direct map. This fixes most compatibility issues we have had in the past supporting older hadoop distributions.
This commit is contained in:
committed by
kannappanr
parent
10a607154d
commit
a2e344bf30
@@ -71,7 +71,7 @@ func checkCopyObjectPreconditions(ctx context.Context, w http.ResponseWriter, r
|
||||
w.Header().Set("Last-Modified", objInfo.ModTime.UTC().Format(http.TimeFormat))
|
||||
|
||||
if objInfo.ETag != "" {
|
||||
w.Header().Set("ETag", "\""+objInfo.ETag+"\"")
|
||||
w.Header()["ETag"] = []string{"\"" + objInfo.ETag + "\""}
|
||||
}
|
||||
}
|
||||
// x-amz-copy-source-if-modified-since: Return the object only if it has been modified
|
||||
@@ -166,7 +166,7 @@ func checkPreconditions(ctx context.Context, w http.ResponseWriter, r *http.Requ
|
||||
w.Header().Set("Last-Modified", objInfo.ModTime.UTC().Format(http.TimeFormat))
|
||||
|
||||
if objInfo.ETag != "" {
|
||||
w.Header().Set("ETag", "\""+objInfo.ETag+"\"")
|
||||
w.Header()["ETag"] = []string{"\"" + objInfo.ETag + "\""}
|
||||
}
|
||||
}
|
||||
// If-Modified-Since : Return the object only if it has been modified since the specified time,
|
||||
|
||||
Reference in New Issue
Block a user