From 1d97e9b37ece8ced50b3133bf75e387d668775b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Tue, 2 May 2017 18:03:14 +0200 Subject: [PATCH] updated protocol enforcing --- server/router.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/router.js b/server/router.js index 2d359162..808af6d1 100644 --- a/server/router.js +++ b/server/router.js @@ -8,10 +8,9 @@ router.use(function(req, res, next) { }); router.route('/:channel_name').get(function(req, res, next){ - var protocol = req.protocol; var subdomain = req.headers['x-forwarded-host'].split("."); - if((subdomain[0] != 'localhost' && !(subdomain.length >= 2 && subdomain[1] == 'localhost')) && protocol != "https") { + if((subdomain[0] != 'localhost' && !(subdomain.length >= 2 && subdomain[1] == 'localhost'))) { res.redirect("https://zoff.me"); return; } @@ -108,10 +107,9 @@ router.route('/api/mail').post(function(req, res) { }); router.route('/').get(function(req, res, next){ - var protocol = req.protocol; var subdomain = req.headers['x-forwarded-host'].split("."); - if((subdomain[0] != 'localhost' && !(subdomain.length >= 2 && subdomain[1] == 'localhost')) && protocol != "https") { + if((subdomain[0] != 'localhost' && !(subdomain.length >= 2 && subdomain[1] == 'localhost'))) { res.redirect("https://zoff.me"); return; }