Skip to content

Commit

Permalink
redirect http
Browse files Browse the repository at this point in the history
  • Loading branch information
bourgeoa committed Jan 28, 2024
1 parent 59f94fb commit 3784e55
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/create-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ function createApp (argv = {}) {
authProxy(app, argv.authProxy)
}

// redirect http to https
app.use(function (req, res, next) {
if (req.protocol === 'http:') {
return res.redirect('https://' + req.headers.host + req.url)
}
next()
})

// Attach the LDP middleware
app.use('/', LdpMiddleware(corsSettings))

Expand Down

0 comments on commit 3784e55

Please sign in to comment.