fix: use equalFold() instead of lower and compare (#13624)

This commit is contained in:
Harshavardhana
2021-11-10 08:12:50 -08:00
committed by GitHub
parent 03725dc015
commit ea820b30bf
9 changed files with 10 additions and 9 deletions

View File

@@ -46,7 +46,8 @@ func (sses3) String() string { return "SSE-S3" }
func (sses3) IsRequested(h http.Header) bool {
_, ok := h[xhttp.AmzServerSideEncryption]
return ok && strings.ToLower(h.Get(xhttp.AmzServerSideEncryption)) != xhttp.AmzEncryptionKMS // Return only true if the SSE header is specified and does not contain the SSE-KMS value
// Return only true if the SSE header is specified and does not contain the SSE-KMS value
return ok && !strings.EqualFold(h.Get(xhttp.AmzServerSideEncryption), xhttp.AmzEncryptionKMS)
}
// ParseHTTP parses the SSE-S3 related HTTP headers and checks