(stream, log)
| 32 | } |
| 33 | |
| 34 | function stripTrailingChecksumStream(stream, log) { |
| 35 | // don't do anything if we are not in the correct integrity check mode |
| 36 | if (stream.headers['x-amz-content-sha256'] !== 'STREAMING-UNSIGNED-PAYLOAD-TRAILER') { |
| 37 | return stream; |
| 38 | } |
| 39 | |
| 40 | const trailingChecksumTransform = new TrailingChecksumTransform(log); |
| 41 | stream.pipe(trailingChecksumTransform); |
| 42 | trailingChecksumTransform.headers = stream.headers; |
| 43 | return trailingChecksumTransform; |
| 44 | } |
| 45 | |
| 46 | module.exports = { |
| 47 | prepareStream, |