| 243 | }); |
| 244 | |
| 245 | function getMetadataToPut(putDataResponse) { |
| 246 | const mdToPut = Object.assign({}, testMd); |
| 247 | // Reproduce what backbeat does to update target metadata |
| 248 | mdToPut.location = JSON.parse(putDataResponse.body); |
| 249 | ['x-amz-server-side-encryption', |
| 250 | 'x-amz-server-side-encryption-aws-kms-key-id', |
| 251 | 'x-amz-server-side-encryption-customer-algorithm'].forEach(headerName => { |
| 252 | if (putDataResponse.headers[headerName]) { |
| 253 | mdToPut[headerName] = putDataResponse.headers[headerName]; |
| 254 | } |
| 255 | }); |
| 256 | return mdToPut; |
| 257 | } |
| 258 | |
| 259 | describe('backbeat routes', () => { |
| 260 | let bucketUtil; |