mirror of
https://github.com/zebrajr/express.git
synced 2025-12-06 00:19:48 +01:00
Merge tag '3.20.3'
This commit is contained in:
commit
62d5c38575
46
History.md
46
History.md
|
|
@ -1,3 +1,18 @@
|
|||
unreleased
|
||||
==========
|
||||
|
||||
* deps: debug@~2.2.0
|
||||
- deps: ms@0.7.1
|
||||
* deps: depd@~1.0.1
|
||||
* deps: proxy-addr@~1.0.8
|
||||
- deps: ipaddr.js@1.0.1
|
||||
* deps: send@0.12.3
|
||||
- deps: debug@~2.2.0
|
||||
- deps: depd@~1.0.1
|
||||
- deps: etag@~1.6.0
|
||||
- deps: ms@0.7.1
|
||||
- deps: on-finished@~2.2.1
|
||||
|
||||
4.12.3 / 2015-03-17
|
||||
===================
|
||||
|
||||
|
|
@ -739,6 +754,37 @@
|
|||
- `app.route()` - Proxy to the app's `Router#route()` method to create a new route
|
||||
- Router & Route - public API
|
||||
|
||||
3.20.3 / 2015-05-17
|
||||
===================
|
||||
|
||||
* deps: connect@2.29.2
|
||||
- deps: body-parser@~1.12.4
|
||||
- deps: compression@~1.4.4
|
||||
- deps: connect-timeout@~1.6.2
|
||||
- deps: debug@~2.2.0
|
||||
- deps: depd@~1.0.1
|
||||
- deps: errorhandler@~1.3.6
|
||||
- deps: finalhandler@0.3.6
|
||||
- deps: method-override@~2.3.3
|
||||
- deps: morgan@~1.5.3
|
||||
- deps: qs@2.4.2
|
||||
- deps: response-time@~2.3.1
|
||||
- deps: serve-favicon@~2.2.1
|
||||
- deps: serve-index@~1.6.4
|
||||
- deps: serve-static@~1.9.3
|
||||
- deps: type-is@~1.6.2
|
||||
* deps: debug@~2.2.0
|
||||
- deps: ms@0.7.1
|
||||
* deps: depd@~1.0.1
|
||||
* deps: proxy-addr@~1.0.8
|
||||
- deps: ipaddr.js@1.0.1
|
||||
* deps: send@0.12.3
|
||||
- deps: debug@~2.2.0
|
||||
- deps: depd@~1.0.1
|
||||
- deps: etag@~1.6.0
|
||||
- deps: ms@0.7.1
|
||||
- deps: on-finished@~2.2.1
|
||||
|
||||
3.20.2 / 2015-03-16
|
||||
===================
|
||||
|
||||
|
|
|
|||
|
|
@ -15,12 +15,20 @@ var users = [
|
|||
, { name: 'bandit' }
|
||||
];
|
||||
|
||||
// Create HTTP error
|
||||
|
||||
function createError(status, message) {
|
||||
var err = new Error(message);
|
||||
err.status = status;
|
||||
return err;
|
||||
}
|
||||
|
||||
// Convert :to and :from to integers
|
||||
|
||||
app.param(['to', 'from'], function(req, res, next, num, name){
|
||||
req.params[name] = parseInt(num, 10);
|
||||
if( isNaN(req.params[name]) ){
|
||||
next(new Error('failed to parseInt '+num));
|
||||
next(createError(400, 'failed to parseInt '+num));
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
|
|
@ -32,7 +40,7 @@ app.param('user', function(req, res, next, id){
|
|||
if (req.user = users[id]) {
|
||||
next();
|
||||
} else {
|
||||
next(new Error('failed to find user'));
|
||||
next(createError(404, 'failed to find user'));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
16
package.json
16
package.json
|
|
@ -32,8 +32,8 @@
|
|||
"content-type": "~1.0.1",
|
||||
"cookie": "0.1.2",
|
||||
"cookie-signature": "1.0.6",
|
||||
"debug": "~2.1.3",
|
||||
"depd": "~1.0.0",
|
||||
"debug": "~2.2.0",
|
||||
"depd": "~1.0.1",
|
||||
"escape-html": "1.0.1",
|
||||
"etag": "~1.5.1",
|
||||
"finalhandler": "0.3.4",
|
||||
|
|
@ -43,10 +43,10 @@
|
|||
"on-finished": "~2.2.0",
|
||||
"parseurl": "~1.3.0",
|
||||
"path-to-regexp": "0.1.3",
|
||||
"proxy-addr": "~1.0.7",
|
||||
"proxy-addr": "~1.0.8",
|
||||
"qs": "2.4.1",
|
||||
"range-parser": "~1.0.2",
|
||||
"send": "0.12.2",
|
||||
"send": "0.12.3",
|
||||
"serve-static": "~1.9.2",
|
||||
"type-is": "~1.6.1",
|
||||
"vary": "~1.0.0",
|
||||
|
|
@ -55,11 +55,11 @@
|
|||
"devDependencies": {
|
||||
"after": "0.8.1",
|
||||
"ejs": "2.3.1",
|
||||
"istanbul": "0.3.8",
|
||||
"istanbul": "0.3.9",
|
||||
"marked": "0.3.3",
|
||||
"mocha": "~2.2.1",
|
||||
"should": "~5.2.0",
|
||||
"supertest": "~0.15.0",
|
||||
"mocha": "2.2.5",
|
||||
"should": "6.0.1",
|
||||
"supertest": "1.0.1",
|
||||
"body-parser": "~1.12.2",
|
||||
"connect-redis": "~2.2.0",
|
||||
"cookie-parser": "~1.3.4",
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ describe('mvc', function(){
|
|||
.put('/pet/3')
|
||||
.set('Content-Type', 'application/x-www-form-urlencoded')
|
||||
.send({ pet: { name: 'Boots' } })
|
||||
.end(function(err, res){
|
||||
.expect(302, function (err, res) {
|
||||
if (err) return done(err);
|
||||
request(app)
|
||||
.get('/pet/3/edit')
|
||||
|
|
@ -105,7 +105,7 @@ describe('mvc', function(){
|
|||
.put('/user/1')
|
||||
.set('Content-Type', 'application/x-www-form-urlencoded')
|
||||
.send({ user: { name: 'Tobo' }})
|
||||
.end(function(err, res){
|
||||
.expect(302, function (err, res) {
|
||||
if (err) return done(err);
|
||||
request(app)
|
||||
.get('/user/1/edit')
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ describe('params', function(){
|
|||
describe('GET /user/9', function(){
|
||||
it('should fail to find user', function(done){
|
||||
request(app)
|
||||
.get('/user/9')
|
||||
.expect(/failed to find user/,done)
|
||||
.get('/user/9')
|
||||
.expect(404, /failed to find user/, done)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
@ -37,8 +37,8 @@ describe('params', function(){
|
|||
describe('GET /users/foo-bar', function(){
|
||||
it('should fail integer parsing', function(done){
|
||||
request(app)
|
||||
.get('/users/foo-bar')
|
||||
.expect(/failed to parseInt foo/,done)
|
||||
.get('/users/foo-bar')
|
||||
.expect(400, /failed to parseInt foo/, done)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user