From dbb71423a8a830f176fcd37cf44a53ee8c5f7690 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 23 Jan 2017 15:17:53 -0500 Subject: [PATCH] executing core middlewares first before secondary or plugin middlewares --- src/routes/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/helpers.js b/src/routes/helpers.js index 3f3ff06472..fd466c78f1 100644 --- a/src/routes/helpers.js +++ b/src/routes/helpers.js @@ -3,7 +3,7 @@ var helpers = {}; helpers.setupPageRoute = function (router, name, middleware, middlewares, controller) { - middlewares = middlewares.concat([middleware.registrationComplete, middleware.pageView, middleware.pluginHooks]); + middlewares = [middleware.registrationComplete, middleware.pageView, middleware.pluginHooks].concat(middlewares); router.get(name, middleware.busyCheck, middleware.buildHeader, middlewares, controller); router.get('/api' + name, middlewares, controller);