@@ -165,20 +165,21 @@ function bucketLevelServerSideEncryption(bucket, headers, log, cb) {
165165 */
166166function createBucket ( authInfo , bucketName , headers ,
167167 locationConstraint , log , cb ) {
168+ // Prefer using undefined instead of null for unused properties so they are not present in metadata payload
168169 log . trace ( 'Creating bucket' ) ;
169170 assert . strictEqual ( typeof bucketName , 'string' ) ;
170171 const canonicalID = authInfo . getCanonicalID ( ) ;
171172 const ownerDisplayName =
172173 authInfo . getAccountDisplayName ( ) ;
173174 const creationDate = new Date ( ) . toJSON ( ) ;
174- const isNFSEnabled = headers [ 'x-scal-nfs-enabled' ] === 'true' ;
175+ const isNFSEnabled = headers [ 'x-scal-nfs-enabled' ] === 'true' || undefined ;
175176 const headerObjectLock = headers [ 'x-amz-bucket-object-lock-enabled' ] ;
176177 const objectLockEnabled
177178 = headerObjectLock && headerObjectLock . toLowerCase ( ) === 'true' ;
178179 const bucket = new BucketInfo ( bucketName , canonicalID , ownerDisplayName ,
179- creationDate , BucketInfo . currentModelVersion ( ) , null , null , null , null ,
180- null , null , null , null , null , null , null , null , null , isNFSEnabled ,
181- null , null , objectLockEnabled ) ;
180+ creationDate , BucketInfo . currentModelVersion ( ) , undefined , undefined , undefined , undefined ,
181+ undefined , undefined , undefined , undefined , undefined , undefined , undefined , undefined , undefined , isNFSEnabled ,
182+ undefined , undefined , objectLockEnabled ) ;
182183 let locationConstraintVal = null ;
183184
184185 if ( locationConstraint ) {
0 commit comments