From 5e6d8ea566b1c356d1252550727edae8f0996237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 14 Oct 2017 08:34:04 -0400 Subject: [PATCH] handle 404 first --- src/controllers/posts.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/posts.js b/src/controllers/posts.js index 4f906fb0ba..5f41d6a9d9 100644 --- a/src/controllers/posts.js +++ b/src/controllers/posts.js @@ -26,12 +26,12 @@ postsController.redirectToPost = function (req, res, next) { }, next); }, function (results, next) { - if (!results.canRead) { - return helpers.notAllowed(req, res); - } if (!results.path) { return next(); } + if (!results.canRead) { + return helpers.notAllowed(req, res); + } helpers.redirect(res, results.path); }, ], next);