(location, key, cb)
| 271 | } |
| 272 | |
| 273 | function mpuSetup(location, key, cb) { |
| 274 | const initiateRequest = { |
| 275 | bucketName, |
| 276 | namespace, |
| 277 | objectKey: key, |
| 278 | headers: { 'host': `${bucketName}.s3.amazonaws.com`, |
| 279 | 'x-amz-meta-scal-location-constraint': location }, |
| 280 | url: `/${key}?uploads`, |
| 281 | parsedHost: 'localhost', |
| 282 | actionImplicitDenies: false, |
| 283 | }; |
| 284 | initiateMultipartUpload(authInfo, initiateRequest, log, |
| 285 | (err, result) => { |
| 286 | assert.strictEqual(err, null, 'Error initiating MPU'); |
| 287 | assertMpuInitResults(result, key, uploadId => { |
| 288 | putParts(uploadId, key, () => { |
| 289 | cb(uploadId); |
| 290 | }); |
| 291 | }); |
| 292 | }); |
| 293 | } |
| 294 | |
| 295 | function putObject(putBackend, objectKey, cb) { |
| 296 | const putParams = Object.assign({ |
no test coverage detected