-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix: Update body_size_limit to use Number instead of parseInt #11589
Conversation
🦋 Changeset detectedLatest commit: 892f318 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Thank you — we also need to error if |
I think this should be a |
hi, could you please review my latest change, I'm not sure doing validation on top-level or somewhere |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add a helpful error message in the case where people are currently using 0 to mean 'Infinity'. will do that now
@Conduitry I think we have to call it breaking because we're changing the meaning of |
thank you! |
Summary
This pull request updates the environment variable handling in our SvelteKit application to support floating-point values for the BODY_SIZE_LIMIT. Previously, the BODY_SIZE_LIMIT was parsed using parseInt, which limited it to integer values. By switching to parseFloat, we can now define more precise limits, improving the flexibility of our application's configuration.
Changes
Changed the parsing method for BODY_SIZE_LIMIT from parseInt to parseFloat. This allows the use of both integers and floating-point numbers, providing more granular control over the body size limit.
Impact
Enhanced Flexibility: Users can now specify decimal values in the BODY_SIZE_LIMIT environment variable, enabling more precise control over request body size limits.
Backward Compatibility: Integer values are still supported. Existing configurations using integer values for BODY_SIZE_LIMIT will continue to work as expected.
solve #11580