diff --git a/src/app.ts b/src/app.ts index 01fb6dc2..947cd52a 100644 --- a/src/app.ts +++ b/src/app.ts @@ -281,15 +281,14 @@ export class GBServer { // Setups unsecure http redirect. const httpServer = express(); - httpServer.use(function (request, response, next) { - if (process.env.NODE_ENV != 'development' && !request.secure) { + httpServer.use( (request, response, next) => { + if (request.headers.host != 'localhost' && !request.secure) { return response.redirect("https://" + request.headers.host + request.url); } next(); }); - if (process.env.CERTIFICATE_PFX) { const options1 = { passphrase: process.env.CERTIFICATE_PASSPHRASE,