mirror of https://github.com/minio/minio.git
[SSE-C]: avoid encrypting empty objects. (#5525)
This change adds an object size check such that the server does not encrypt empty objects (typically folders) for SSE-C. The server still returns SSE-C headers but the object is not encrypted since there is no point to encrypt such objects. Fixes #5493
This commit is contained in:
parent
91101b11bb
commit
4ca10479b5
|
@ -556,7 +556,7 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req
|
|||
return
|
||||
}
|
||||
if objectAPI.IsEncryptionSupported() {
|
||||
if IsSSECustomerRequest(r.Header) { // handle SSE-C requests
|
||||
if IsSSECustomerRequest(r.Header) && size > 0 { // handle SSE-C requests
|
||||
reader, err = EncryptRequest(hashReader, r, metadata)
|
||||
if err != nil {
|
||||
writeErrorResponse(w, toAPIErrorCode(err), r.URL)
|
||||
|
|
Loading…
Reference in New Issue