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

remove the limit middleware #925

Closed
wants to merge 1 commit into from
Closed

remove the limit middleware #925

wants to merge 1 commit into from

Conversation

jonathanong
Copy link
Contributor

module.exports = function(){
throw new Error('As of version 3.0.0, connect no longer has the limit middleware as it is no longer used internally.');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing ;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha meh most people who use semicolons including tj aren't consistent with functions or multiline statements

@jonathanong jonathanong deleted the remove-limit branch October 18, 2013 07:12
@VRMink
Copy link

VRMink commented Oct 24, 2013

Why was limit removed?
Did some other functionality replace it? I would like to be able to limit the request sizes of what I am consuming.

@dougwilson
Copy link
Contributor

The main reason it was removed is because unless the client send a content-length header, in node >= 0.10, it did not work because of the new streams (and it cannot). The limiting of a body (especially with chunked transfer encoding) just needs to be moved into whatever modules are consuming the body.

@jonathanong
Copy link
Contributor Author

Yeah it's built into the parsers now. It was terrible code for streams2.

@reverofevil
Copy link

For anyone complaining:

// Sideaffect is `limit` will miss the first chunk,
// but that's not a big deal.
// Unfortunately, the tests don't have large enough
// request bodies to test this.

The code wasn't meant to work properly anyway.

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

Successfully merging this pull request may close these issues.

None yet

5 participants