(bucket, key, size, vID, cb)
| 98 | } |
| 99 | |
| 100 | function putObjectWithCustomHeader(bucket, key, size, vID, cb) { |
| 101 | const params = { |
| 102 | Bucket: bucket, |
| 103 | Key: key, |
| 104 | Body: Buffer.alloc(size), |
| 105 | }; |
| 106 | |
| 107 | const command = new PutObjectCommand(params); |
| 108 | command.middlewareStack.add( |
| 109 | next => async args => { |
| 110 | // eslint-disable-next-line no-param-reassign |
| 111 | args.request.headers['x-scal-s3-version-id'] = vID; |
| 112 | return next(args); |
| 113 | }, |
| 114 | { step: 'build' } |
| 115 | ); |
| 116 | |
| 117 | return s3Client.send(command) |
| 118 | .then(data => { |
| 119 | if (!s3Config.isQuotaInflightEnabled()) { |
| 120 | mockScuba.incrementBytesForBucket(bucket, 0); |
| 121 | } |
| 122 | cb(null, data); |
| 123 | }) |
| 124 | .catch(cb); |
| 125 | } |
| 126 | |
| 127 | function copyObject(bucket, key, sourceSize, cb) { |
| 128 | return s3Client.send(new CopyObjectCommand({ |
no test coverage detected