@@ -24,6 +24,7 @@ const monitoring = require('../utilities/metrics');
2424const { getObjectSSEConfiguration } = require ( './apiUtils/bucket/bucketEncryption' ) ;
2525const { setExpirationHeaders } = require ( './apiUtils/object/expirationHeaders' ) ;
2626const { setSSEHeaders } = require ( './apiUtils/object/sseHeaders' ) ;
27+ const { updateEncryption } = require ( './apiUtils/bucket/updateEncryption' ) ;
2728
2829const versionIdUtils = versioning . VersionID ;
2930const locationHeader = constants . objectLocationConstraintHeader ;
@@ -251,6 +252,8 @@ function objectCopy(authInfo, request, sourceBucket,
251252 return async . waterfall ( [
252253 function checkDestAuth ( next ) {
253254 return metadataValidateBucketAndObj ( valPutParams , log ,
255+ ( err , destBucketMD , destObjMD ) =>
256+ updateEncryption ( err , destBucketMD , destObjMD , destObjectKey , log , { skipObject : true } ,
254257 ( err , destBucketMD , destObjMD ) => {
255258 if ( err ) {
256259 log . debug ( 'error validating put part of request' ,
@@ -265,7 +268,7 @@ function objectCopy(authInfo, request, sourceBucket,
265268 return next ( errors . NoSuchBucket ) ;
266269 }
267270 return next ( null , destBucketMD , destObjMD ) ;
268- } ) ;
271+ } ) ) ;
269272 } ,
270273 function checkSourceAuthorization ( destBucketMD , destObjMD , next ) {
271274 return metadataValidateBucketAndObj ( valGetParams , log ,
0 commit comments