RequestFileTooLargeError
is not raised with streams even though fileSize
limit is set
#383
Closed
2 tasks done
Prerequisites
Fastify version
4.4.0
Plugin version
7.1.0
Node.js version
18.0.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
12.3
Description
Thanks for this plugin.
I use
@fastify/multipart
for image upload and noticed thatRequestFileTooLargeError
is not raised with file streams in production env.Here is the test in the current codebase that supposed to test that this error raised and it's raised with in-memory random buffer not bound to disk IO delays.
Although if one replaces
randomFileBuffer
with real streamfs.createReadStream('/tmp/images/15mb.jpeg')
bigger thanfileSize
test starts to fail, but it expected to pass.It's not obvious to me why error is not propagated in this case or should it at all.
Steps to Reproduce
Replace
randomFileBuffer
withfs.createReadStream('/tmp/images/15mb.jpeg')
in this test.Expected Behavior
I expect that
RequestFileTooLargeError
would be raised when read stream supplied.The text was updated successfully, but these errors were encountered: