mirror of
https://github.com/dap-ps/discover.git
synced 2025-01-31 11:35:18 +00:00
add a redirect to https for production
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
8620df672d
commit
4f876d5a96
@ -8,6 +8,15 @@ 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()
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user