Skip to content

Commit

Permalink
support x-forwarded-for for multiverse
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Jul 7, 2024
1 parent a918b11 commit 70e655e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ app.use(function(req, res, next){
req.universe = process.env.UNIVERSE;
} else if(req.app.get('env') === 'production'){
req.universe = req.hostname.replace('.r-universe.dev', '');
res.locals.vhost = req.headers['x-forwarded-for'];
}
res.locals.universe = req.universe || 'ropensci';
res.locals.node_env = req.app.get('env');
Expand Down
4 changes: 1 addition & 3 deletions views/pkginfo.pug
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ block content
| c(
span.pl-s
span.pl-pds '
| https://
span.title-universe-name #{universe}
| .r-universe.dev
| https://#{vhost || `${universe}.r-universe.dev`}
span.pl-pds '
| ,
span.pl-s
Expand Down

0 comments on commit 70e655e

Please sign in to comment.