-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
Add support for removing body parser limit #493
Comments
Hi @ImRodry that should be possible already. Does |
Ok, I just tested and |
Hello @dougwilson I did find the Infinity workaround but that is not ideal. Adding support for a null limit would not be a breaking change because null is an explicitly empty value, as opposed to undefined which is meant to be ignored. Furthermore users in TS are currently not allowed to set the limit to null. I believe this should be added in a minor version. |
Thank you for your perspective. Unfortunately I cannot do that due to the existing behavior and the change introducing a DoS vector to existing users, even if you believe that they are using it "incorrectly" -- it is not a risk we will expose our users to without a major version increase. As for typescript definitions, I believe you would need to open an issue on definitely typed project, as that is where the definitions are maintained. |
Ah I forgot express doesn't export its own types (it really should) |
There is a meta issue for this, but the project does not have any members who are here to maintain TypeScript definitions or have knowledge of it. Until we do, the definitely typed project maintains them for us.
I cannot answer why folks do strange things. It is a consequence of having a HUGE user base. We have been burned many, many times for attempting to release these types of fixes in a non-mjaor and just have to roll them back almost every time. This one would actually cause a security issue, so we definitely take the conservative line.
I mean, a new 2.0 was just release a few days ago... it is actively being push though the pipes for testing to be released and it's stale at all. I'm sorry you don't like that our API is |
I had no idea 2.0 versions were being pushed but like I said I don't use this library directly, I use express which imports it, so it wouldn't be practical to install a version other than the one express ships with. Either way the first beta was published more than a year ago, which is why I asked when it was gonna be fully released, and most importantly when it will be added to express. |
Either way I am using the Infinity limit at the moment, it just didn't seem intentional that that works and I'd rather use null, but I understand your motives |
The body parser libraries support passing a null limit, however the types for body-parser and express don't allow this, same for the code which uses a logical OR to set the default, which would override
null
. You should instead use JS's default parameters and stop using such outdated code to support this, because some of us don't want set limits on the amount of data we want to receive.The text was updated successfully, but these errors were encountered: