We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba0bf3a commit 26d52a8Copy full SHA for 26d52a8
1 file changed
lib/auth/streamingV4/trailingChecksumTransform.js
@@ -1,5 +1,6 @@
1
const { Transform } = require('stream');
2
const { errors } = require('arsenal');
3
+const { maximumAllowedPartSize } = require('../../../constants');
4
5
/**
6
* This class is designed to handle the chunks sent in a streaming
@@ -103,6 +104,10 @@ class TrailingChecksumTransform extends Transform {
103
104
// last chunk, no more data to read, the stream is closed
105
this.streamClosed = true;
106
}
107
+ if (dataSize > maximumAllowedPartSize) {
108
+ this.log.error('chunk size too big', { dataSize });
109
+ return callback(errors.EntityTooLarge);
110
+ }
111
this.bytesToRead = dataSize;
112
this.bytesToDiscard = 2;
113
0 commit comments