1
0
mirror of https://github.com/minio/minio.git synced 2025-03-13 13:02:57 -04:00

Directory HEADs with encryption headers shouldn't return errors ()

Since we do not encrypt directories we don't need to send
errors with encryption headers when the directory doesn't
have encryption metadata.

Continuation PR from 4ca10479b58c0557c7c8c7c58b623e40b2671c88
This commit is contained in:
Harshavardhana 2018-02-15 14:18:28 -08:00 committed by kannappanr
parent 22897de4c7
commit dd80256151

@ -240,7 +240,8 @@ func (api objectAPIHandlers) HeadObjectHandler(w http.ResponseWriter, r *http.Re
writeErrorResponseHeadersOnly(w, apiErr)
return
}
if objectAPI.IsEncryptionSupported() {
if objectAPI.IsEncryptionSupported() && !objInfo.IsDir {
if apiErr, encrypted := DecryptObjectInfo(&objInfo, r.Header); apiErr != ErrNone {
writeErrorResponse(w, apiErr, r.URL)
return
@ -342,17 +343,18 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re
return
}
if IsSSECustomerRequest(r.Header) { // handle SSE-C requests
// SSE-C is not implemented for CopyObject operations yet
writeErrorResponse(w, ErrNotImplemented, r.URL)
return
}
// Check if metadata directive is valid.
if !isMetadataDirectiveValid(r.Header) {
writeErrorResponse(w, ErrInvalidMetadataDirective, r.URL)
return
}
if IsSSECustomerRequest(r.Header) { // handle SSE-C requests
// SSE-C is not implemented for CopyObject operations yet
writeErrorResponse(w, ErrNotImplemented, r.URL)
return
}
cpSrcDstSame := srcBucket == dstBucket && srcObject == dstObject
objInfo, err := objectAPI.GetObjectInfo(srcBucket, srcObject)