From 04a860aa383006cf5ab282cd02529c4e0cd67a20 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Tue, 26 Mar 2013 15:18:34 +0100 Subject: added 403 when posting to wrong page --- router.js | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'router.js') diff --git a/router.js b/router.js index 50b5419..3d9558c 100644 --- a/router.js +++ b/router.js @@ -52,32 +52,19 @@ module.exports = function(app) { - - - - - - - /* - * 404 ERROR + * ERRORS */ + /* 404 */ app.get('*', function(req, res) { res.render('error', { title: '404', text: 'Fant ikke siden' }); }); + /* 403 on POST */ + app.post('*', function(req, res) { + res.render('error', { title: '403', text: 'Du har ikke tilgang til denne siden' }); + }); - - - - - - - - - - - -} +}; -- cgit v1.2.3