Socket
Socket
Sign inDemoInstall

connect

Package Overview
Dependencies
Maintainers
0
Versions
234
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

2

lib/connect.js

@@ -29,3 +29,3 @@

exports.version = '1.1.1';
exports.version = '1.1.2';

@@ -32,0 +32,0 @@ /**

@@ -11,4 +11,6 @@

*
* When exceeded, the request will emit an "error" event,
* and the limit can be checked via `error.limit`.
* When exceeded, `next()` is invoked with an exception
* unless the request "limit" event has one or more
* listeners. The limit can be checked via `error.limit`,
* and bytes received via `error.received`.
*

@@ -24,2 +26,14 @@ * A string representation of the bytesize may also be passed,

*
* Example route usage
*
* req.on('limit', function(err){
* res.end('uploaded failed due to exceeding ' + err.limit + ' bytes');
* });
*
* req.on('end', function(err){
* res.end('upload successful');
* });
*
* TODO: utilize Content-Length
*
* @param {Number|String} bytes

@@ -45,6 +59,11 @@ * @return {Function}

if (received > bytes && !done) {
done = true;
var err = new Error('limit of ' + bytes + ' bytes exceeded');
err.limit = bytes;
req.emit('error', err);
err.received = received;
done = true;
if (req.listeners('limit').length) {
req.emit('limit', err);
} else {
next(err);
}
}

@@ -51,0 +70,0 @@ });

{
"name": "connect",
"version": "1.1.1",
"version": "1.1.2",
"description": "High performance middleware framework",

@@ -5,0 +5,0 @@ "keywords": ["framework", "web", "middleware", "connect", "rack"],

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc