diff --git a/lib/controllers/Controller.js b/lib/controllers/Controller.js index d319d07e..1f12fd3a 100644 --- a/lib/controllers/Controller.js +++ b/lib/controllers/Controller.js @@ -30,7 +30,7 @@ Controller.extend = function extend(child) { }; // Tries to process the HTTP request -Controller.prototype.handleRequest = function (request, response, next) { +Controller.prototype.handleRequest = function (request, response, next, settings) { // Add a `parsedUrl` field to `request`, // containing the parsed request URL, resolved against the base URL if (!request.parsedUrl) { @@ -41,7 +41,7 @@ Controller.prototype.handleRequest = function (request, response, next) { // Try to handle the request var self = this; - try { this._handleRequest(request, response, done); } + try { this._handleRequest(request, response, done, settings); } catch (error) { done(error); } function done(error) { if (self) { @@ -55,7 +55,7 @@ Controller.prototype.handleRequest = function (request, response, next) { }; // Tries to process the HTTP request in an implementation-specific way -Controller.prototype._handleRequest = function (request, response, next) { +Controller.prototype._handleRequest = function (request, response, next, settings) { next(); }; diff --git a/test/controllers/Controller-test.js b/test/controllers/Controller-test.js index 64aa59e3..de6159c0 100644 --- a/test/controllers/Controller-test.js +++ b/test/controllers/Controller-test.js @@ -36,7 +36,6 @@ describe('Controller', function () { it('should call _handleRequest with request, response and next', function () { controller._handleRequest.should.have.been.calledOnce; var args = controller._handleRequest.getCall(0).args; - args.should.have.length(3); args[0].should.have.property('url'); args[1].should.be.an.instanceof(http.ServerResponse); args[2].should.be.an.instanceof(Function); @@ -75,7 +74,6 @@ describe('Controller', function () { it('should call _handleRequest with request, response and next', function () { controller._handleRequest.should.have.been.calledOnce; var args = controller._handleRequest.getCall(0).args; - args.should.have.length(3); args[0].should.have.property('url'); args[1].should.be.an.instanceof(http.ServerResponse); args[2].should.be.an.instanceof(Function);