From a6256cac1df1739e3da78fe5f0cf122ef7ce6b14 Mon Sep 17 00:00:00 2001 From: yawnt Date: Tue, 3 Sep 2013 20:56:18 +0200 Subject: [PATCH] [fix] short circuit --- lib/caronte/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/caronte/index.js b/lib/caronte/index.js index 6700a4396..eaa55872d 100644 --- a/lib/caronte/index.js +++ b/lib/caronte/index.js @@ -35,12 +35,14 @@ function createRightProxy(type) { ev = 'caronte:' + type + ':'; //self.emit(ev + 'begin', req, res); - passes.forEach(function(pass) { + + passes.every(function(pass) { var evnt = ev + pass.name.toLowerCase(); //self.emit(evnt + 'begin', req, res); - pass(req, res, options, self); + var val = pass(req, res, options, self); //self.emit(evnt + 'end'); + return val; }); //self.emit(ev + 'end');