fix(all): Minor changes in PROD.

This commit is contained in:
Rodrigo Rodriguez 2023-07-09 13:09:28 -03:00
parent 76df151507
commit 892025e5b2

View file

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