Skip to content

Commit

Permalink
Use req.get('host') to properly pick up x-forwarded headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgi1324 committed Nov 15, 2024
1 parent d81d7c9 commit 89ab254
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/addon/src/serverless.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ router.get('/:configuration?/:resource/:type/:id/:extra?.json', limiter, (req, r
const { configuration, resource, type, id } = req.params;
const extra = req.params.extra ? qs.parse(req.url.split('/').pop().slice(0, -5)) : {}
const ip = requestIp.getClientIp(req);
const host = `${req.protocol}://${req.headers.host}`;
const host = `${req.protocol}://${req.get('host')}`;
console.log(`Host is ${host}`);
const configValues = { ...extra, ...parseConfiguration(configuration), id, type, ip, host };
addonInterface.get(resource, type, id, configValues)
Expand Down

0 comments on commit 89ab254

Please sign in to comment.