Skip to content

Commit 06f423d

Browse files
wesleytodddougwilson
authored andcommitted
Remove Express 3.x middleware error stubs
closes #3217
1 parent 501e24e commit 06f423d

File tree

3 files changed

+2
-42
lines changed

3 files changed

+2
-42
lines changed

History.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
This incorporates all changes after 4.14.1 up to 4.15.0.
55

6+
* remove:
7+
- Remove Express 3.x middleware error stubs
68
* deps: router@~1.3.0
79
- Add `next("router")` to exit from router
810
- Fix case where `router.use` skipped requests routes did not

lib/express.js

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -74,37 +74,3 @@ exports.Router = Router;
7474
*/
7575

7676
exports.static = require('serve-static');
77-
78-
/**
79-
* Replace removed middleware with an appropriate error message.
80-
*/
81-
82-
[
83-
'json',
84-
'urlencoded',
85-
'bodyParser',
86-
'compress',
87-
'cookieSession',
88-
'session',
89-
'logger',
90-
'cookieParser',
91-
'favicon',
92-
'responseTime',
93-
'errorHandler',
94-
'timeout',
95-
'methodOverride',
96-
'vhost',
97-
'csrf',
98-
'directory',
99-
'limit',
100-
'multipart',
101-
'staticCache',
102-
'query',
103-
].forEach(function (name) {
104-
Object.defineProperty(exports, name, {
105-
get: function () {
106-
throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');
107-
},
108-
configurable: true
109-
});
110-
});

test/exports.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,4 @@ describe('exports', function(){
5050
.get('/')
5151
.expect('bar', done);
5252
})
53-
54-
it('should throw on old middlewares', function(){
55-
var error;
56-
try { express.bodyParser; } catch (e) { error = e; }
57-
should(error).have.property('message');
58-
error.message.should.containEql('middleware');
59-
error.message.should.containEql('bodyParser');
60-
})
6153
})

0 commit comments

Comments
 (0)