From 5292a47a96cdf6bc45c61061529dd9d18a41deb4 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 18 Nov 2014 15:50:49 -0500 Subject: [PATCH] fixed maintenance mode page not working with new CSRF implementation, #2424 --- src/middleware/middleware.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js index d5d19710e8..0693c39d5f 100644 --- a/src/middleware/middleware.js +++ b/src/middleware/middleware.js @@ -465,10 +465,12 @@ middleware.maintenanceMode = function(req, res, next) { res.status(503); if (!isApiRoute.test(req.url)) { - middleware.buildHeader(req, res, function() { - res.render('maintenance', { - site_title: meta.config.title || 'NodeBB', - message: meta.config.maintenanceModeMessage + middleware.applyCSRF(req, res, function() { + middleware.buildHeader(req, res, function() { + res.render('maintenance', { + site_title: meta.config.title || 'NodeBB', + message: meta.config.maintenanceModeMessage + }); }); }); } else {