Commit 48ba4619d04ded0617eea07dbdd3be6f251849aa

Authored by Adhidarma Hadiwinoto
1 parent 23bee92dd5
Exists in master

Trust proxy by config.partner.callback.trust_proxy

Showing 2 changed files with 9 additions and 0 deletions Side-by-side Diff

... ... @@ -12,6 +12,7 @@
12 12 "apikey": [
13 13 "PLEASE_CHANGE_ME"
14 14 ],
  15 + "trust_proxy": ["loopback"],
15 16 "dump_request": true
16 17 }
17 18 },
lib/callback/index.js
... ... @@ -26,6 +26,14 @@ if (!listenPort) {
26 26 process.exit(1);
27 27 }
28 28  
  29 +if (config.partner && config.partner.callback && config.partner.callback.trust_proxy) {
  30 + logger.verbose(`${MODULE_NAME} 9774C2DB: Trusting proxy`, {
  31 + trusted: config.partner.callback.trust_proxy,
  32 + });
  33 +
  34 + app.set('trust proxy', config.partner.callback.trust_proxy);
  35 +}
  36 +
29 37 app.use((req, res, next) => {
30 38 res.locals.xid = uniqid();
31 39 next();