Skip to content

Commit

Permalink
fix host port
Browse files Browse the repository at this point in the history
  • Loading branch information
nojhamster committed Oct 4, 2019
1 parent 21a429c commit 5eac10e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ app.use(function (req, res, next) {
* Uses X-Forwarded-Proto and X-Forwarded-Host if provided by a reverse proxy
*/
app.use(function (req, res, next) {
req.ezBaseURL = `${req.protocol}://${req.hostname}`;
const host = req.headers['x-forwarded-host'] || req.headers.host;
req.ezBaseURL = `${req.protocol}://${host}`;
next();
});

Expand Down

0 comments on commit 5eac10e

Please sign in to comment.