Skip to content

Commit

Permalink
Merge pull request nightscout#4778 from mastacheata/patch-2
Browse files Browse the repository at this point in the history
Perform HTTP to HTTPS redirect using 307 status
  • Loading branch information
sulkaharo authored Jul 23, 2019
2 parents 561f42a + 7f5f74c commit 3d5fc8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function create(env, ctx) {
if (req.header('x-forwarded-proto') == 'https' || req.secure) {
next();
} else {
res.redirect(`https://${req.header('host')}${req.url}`);
res.redirect(307, `https://${req.header('host')}${req.url}`);
}
})
if (secureHstsHeader) { // Add HSTS (HTTP Strict Transport Security) header
Expand Down Expand Up @@ -292,4 +292,4 @@ function create(env, ctx) {
//}
return app;
}
module.exports = create;
module.exports = create;

0 comments on commit 3d5fc8d

Please sign in to comment.