S3 Gateway: Check for encryption headers properly (#10309)

This commit is contained in:
kannappanr
2020-08-22 11:41:49 -07:00
committed by GitHub
parent 0ff246653b
commit d15a5ad4cc
2 changed files with 14 additions and 1 deletions

View File

@@ -65,6 +65,17 @@ func RemoveInternalEntries(metadata map[string]string) {
delete(metadata, S3KMSSealedKey)
}
// IsSourceEncrypted returns true if the source is encrypted
func IsSourceEncrypted(metadata map[string]string) bool {
if _, ok := metadata[SSECAlgorithm]; ok {
return true
}
if _, ok := metadata[SSEHeader]; ok {
return true
}
return false
}
// IsEncrypted returns true if the object metadata indicates
// that it was uploaded using some form of server-side-encryption.
//