(bucketLoc, mpuLoc, srcObjLoc, requestHost, cb, errorPutCopyPart)
| 63 | } |
| 64 | |
| 65 | function copyPutPart(bucketLoc, mpuLoc, srcObjLoc, requestHost, cb, |
| 66 | errorPutCopyPart) { |
| 67 | const keys = getSourceAndDestKeys(); |
| 68 | const { sourceObjName, destObjName } = keys; |
| 69 | const post = bucketLoc ? '<?xml version="1.0" encoding="UTF-8"?>' + |
| 70 | '<CreateBucketConfiguration ' + |
| 71 | 'xmlns="http://s3.amazonaws.com/doc/2006-03-01/">' + |
| 72 | `<LocationConstraint>${bucketLoc}</LocationConstraint>` + |
| 73 | '</CreateBucketConfiguration>' : ''; |
| 74 | const bucketPutReq = new DummyRequest({ |
| 75 | bucketName, |
| 76 | namespace, |
| 77 | headers: { host: `${bucketName}.s3.amazonaws.com` }, |
| 78 | url: '/', |
| 79 | post, |
| 80 | }); |
| 81 | if (requestHost) { |
| 82 | bucketPutReq.parsedHost = requestHost; |
| 83 | } |
| 84 | const initiateReq = { |
| 85 | bucketName, |
| 86 | namespace, |
| 87 | objectKey: destObjName, |
| 88 | headers: { host: `${bucketName}.s3.amazonaws.com` }, |
| 89 | url: `/${destObjName}?uploads`, |
| 90 | actionImplicitDenies: false, |
| 91 | }; |
| 92 | if (mpuLoc) { |
| 93 | initiateReq.headers = { 'host': `${bucketName}.s3.amazonaws.com`, |
| 94 | 'x-amz-meta-scal-location-constraint': `${mpuLoc}` }; |
| 95 | } |
| 96 | if (requestHost) { |
| 97 | initiateReq.parsedHost = requestHost; |
| 98 | } |
| 99 | const sourceObjPutParams = { |
| 100 | bucketName, |
| 101 | namespace, |
| 102 | objectKey: sourceObjName, |
| 103 | headers: { host: `${bucketName}.s3.amazonaws.com` }, |
| 104 | url: '/', |
| 105 | actionImplicitDenies: false, |
| 106 | }; |
| 107 | if (srcObjLoc) { |
| 108 | sourceObjPutParams.headers = { 'host': `${bucketName}.s3.amazonaws.com`, |
| 109 | 'x-amz-meta-scal-location-constraint': `${srcObjLoc}` }; |
| 110 | } |
| 111 | const sourceObjPutReq = new DummyRequest(sourceObjPutParams, body); |
| 112 | if (requestHost) { |
| 113 | sourceObjPutReq.parsedHost = requestHost; |
| 114 | } |
| 115 | |
| 116 | async.waterfall([ |
| 117 | next => { |
| 118 | bucketPut(authInfo, bucketPutReq, log, err => { |
| 119 | assert.ifError(err, 'Error putting bucket'); |
| 120 | next(err); |
| 121 | }); |
| 122 | }, |
no test coverage detected