Skip to content
This repository was archived by the owner on Mar 10, 2024. It is now read-only.

Commit 39f8710

Browse files
redirect tls when active
1 parent 98a35cf commit 39f8710

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ app.use('/', index);
5151
app.use('/editor', editor);
5252
app.use('/legal', legal);
5353

54+
// redirect to https when ssl is active
55+
if (config.SSL) {
56+
app.get('*', function(req, res) {
57+
res.redirect('https://' + req.headers.host + req.url);
58+
});
59+
}
5460

5561
// 404 error
5662
app.all('*', (req, res) => {

0 commit comments

Comments
 (0)