busboy
busboy copied to clipboard
Filesize limit fails unless is a rounded integer
Was just using arbitrary values for testing the file size limit and it always had truncate set to false - and the limit event on file was never getting hit. Was very confusing until I rounded the number.
Example that fails:
const bb = Busboy({
headers: event.node.req.headers,
limits: {
fileSize: (0.005 * 1024 * 1024)
}
})
Example that works:
const bb = Busboy({
headers: event.node.req.headers,
limits: {
fileSize: Math.floor(0.005 * 1024 * 1024)
}
})
Maybe round this on the busboy end to save morons like me time?