connect-timeout
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -0,1 +1,8 @@ | ||
1.4.0 / 2014-10-16 | ||
================== | ||
* Create errors with `http-errors` | ||
* deps: debug@~2.1.0 | ||
- Implement `DEBUG_FD` env variable support | ||
1.3.0 / 2014-09-03 | ||
@@ -2,0 +9,0 @@ ================== |
15
index.js
@@ -12,2 +12,3 @@ /*! | ||
var createError = require('http-errors'); | ||
var debug = require('debug')('connect:timeout'); | ||
@@ -67,15 +68,9 @@ var ms = require('ms'); | ||
function generateTimeoutError(){ | ||
var err = new Error('Response timeout'); | ||
err.code = 'ETIMEDOUT'; | ||
err.status = 503; | ||
return err; | ||
} | ||
function onTimeout(time, cb){ | ||
return function(){ | ||
var err = generateTimeoutError(); | ||
err.timeout = time; | ||
cb(err); | ||
cb(createError(503, 'Response timeout', { | ||
code: 'ETIMEDOUT', | ||
timeout: time | ||
})); | ||
}; | ||
} |
{ | ||
"name": "connect-timeout", | ||
"description": "timeout middleware", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"contributors": [ | ||
@@ -12,3 +12,4 @@ "Douglas Christopher Wilson <doug@somethingdoug.com>", | ||
"dependencies": { | ||
"debug": "~2.0.0", | ||
"debug": "~2.1.0", | ||
"http-errors": "~1.2.7", | ||
"ms": "0.6.2", | ||
@@ -18,6 +19,6 @@ "on-headers": "~1.0.0" | ||
"devDependencies": { | ||
"istanbul": "0.3.0", | ||
"istanbul": "0.3.2", | ||
"mocha": "~1.21.4", | ||
"should": "~4.0.4", | ||
"supertest": "~0.13.0" | ||
"supertest": "~0.14.0" | ||
}, | ||
@@ -24,0 +25,0 @@ "files": [ |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
8443
4
60
1
+ Addedhttp-errors@~1.2.7
+ Addeddebug@2.1.3(transitive)
+ Addedhttp-errors@1.2.8(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedms@0.7.0(transitive)
+ Addedstatuses@1.5.0(transitive)
- Removeddebug@2.0.0(transitive)
Updateddebug@~2.1.0