Skip to content

Commit

Permalink
Trial on HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
GMPrakhar committed Mar 12, 2020
1 parent 0c80c48 commit 994abf6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ app.set('view engine', 'ejs');


// Allow only https connections
app.get('*', function(req, res) {
app.get('*', function(req, res, next) {
console.log(req.secure);
if(!req.secure)
res.redirect('https://' + req.headers.host + req.url);
else
next();
})


Expand Down

0 comments on commit 994abf6

Please sign in to comment.