Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filesize limit fails unless is a rounded integer #329

Closed
shanehoban opened this issue Dec 6, 2022 · 0 comments
Closed

Filesize limit fails unless is a rounded integer #329

shanehoban opened this issue Dec 6, 2022 · 0 comments

Comments

@shanehoban
Copy link

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?

@shanehoban shanehoban closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant