Hack at ssl redirect
This commit is contained in:
parent
8a29eb8f50
commit
1f3d692007
1 changed files with 2 additions and 2 deletions
4
app.js
4
app.js
|
@ -34,8 +34,8 @@ app.use(express.static(path.join(__dirname, 'public')));
|
|||
|
||||
// force SSL
|
||||
app.get('*', function(req,res,next) {
|
||||
if (req.headers['x-forwarded-proto'] && req.headers['x-forwarded-proto'] != 'https') {
|
||||
res.redirect(req.headers['host'] + req.url);
|
||||
if (req.headers['cf-visitor'] && req.headers['cf-visitor'] != '{"scheme":"https"}') {
|
||||
res.redirect("https://" + req.headers['host'] + req.url);
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue