Added "trust proxy" to members API app

no issue

- match the other express apps, makes sure that we have access to the correct IP and forwarded host names when running behind proxies
This commit is contained in:
Kevin Ansfield 2020-02-20 18:19:07 +00:00
parent b2940692e2
commit 2f55baccd7

View File

@ -13,6 +13,10 @@ module.exports = function setupMembersApiApp() {
const apiApp = express();
apiApp.use(sentry.requestHandler);
// Make sure `req.ip` is correct for proxied requests
// (X-Forwarded-Proto header will be checked, if present)
apiApp.enable('trust proxy');
// Entire app is behind labs flag
apiApp.use(labs.members);