@@ -24,6 +24,7 @@ const monitoring = require('../utilities/metrics');
24
24
const { getObjectSSEConfiguration } = require ( './apiUtils/bucket/bucketEncryption' ) ;
25
25
const { setExpirationHeaders } = require ( './apiUtils/object/expirationHeaders' ) ;
26
26
const { setSSEHeaders } = require ( './apiUtils/object/sseHeaders' ) ;
27
+ const { updateEncryption } = require ( './apiUtils/bucket/updateEncryption' ) ;
27
28
28
29
const versionIdUtils = versioning . VersionID ;
29
30
const locationHeader = constants . objectLocationConstraintHeader ;
@@ -251,6 +252,8 @@ function objectCopy(authInfo, request, sourceBucket,
251
252
return async . waterfall ( [
252
253
function checkDestAuth ( next ) {
253
254
return metadataValidateBucketAndObj ( valPutParams , log ,
255
+ ( err , destBucketMD , destObjMD ) =>
256
+ updateEncryption ( err , destBucketMD , destObjMD , destObjectKey , log , { skipObject : true } ,
254
257
( err , destBucketMD , destObjMD ) => {
255
258
if ( err ) {
256
259
log . debug ( 'error validating put part of request' ,
@@ -265,7 +268,7 @@ function objectCopy(authInfo, request, sourceBucket,
265
268
return next ( errors . NoSuchBucket ) ;
266
269
}
267
270
return next ( null , destBucketMD , destObjMD ) ;
268
- } ) ;
271
+ } ) ) ;
269
272
} ,
270
273
function checkSourceAuthorization ( destBucketMD , destObjMD , next ) {
271
274
return metadataValidateBucketAndObj ( valGetParams , log ,
0 commit comments