express-sslify icon indicating copy to clipboard operation
express-sslify copied to clipboard

Next() for Localhost

Open grod220 opened this issue 7 years ago • 1 comments

Whenever I use this package, it doesn't work in my local environment because https://localhost:### throws errors. Can we add another check like this?

if(req.headers && req.headers.host && req.headers.host === 'localhost:####') { next(); }

grod220 avatar Dec 09 '17 11:12 grod220

Maybe just do something like this?

if (app.get("env") === "production") {
   app.use(enforce.HTTPS({ trustProtoHeader: true }));
}

roelandxyz avatar Mar 01 '19 18:03 roelandxyz