From f21768eee7e263a26bfe0bb7fdd4e126bf081f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Tue, 5 Nov 2019 17:21:20 +0100 Subject: [PATCH] drop https redirect, CloudFront does it for us MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- back-end/routes/api-router.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/back-end/routes/api-router.js b/back-end/routes/api-router.js index 363a56d..2b07335 100644 --- a/back-end/routes/api-router.js +++ b/back-end/routes/api-router.js @@ -8,15 +8,6 @@ class APIRouter { /* for ElasticBeanstalk Load Balancer healthcheck */ app.use('/healthcheck', async (req, res) => res.send('OK')) - - /* redirect if not on https on prod */ - app.use(async (req, res, next) => { - if (req.get('x-forwarded-proto') == 'http') { - res.redirect('https://' + req.headers.host + req.url); - } else { - next() - } - }); } }