From b62ac06bd1a16267502660ebffef4566ac797501 Mon Sep 17 00:00:00 2001 From: Wingy Date: Mon, 2 Nov 2020 17:22:07 -0500 Subject: [PATCH] v1.15.0: TRUST_PROXY --- config/index.js | 3 ++- index.js | 1 + package.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/index.js b/config/index.js index f13b502..f0a9780 100644 --- a/config/index.js +++ b/config/index.js @@ -14,5 +14,6 @@ module.exports = { shortTitle: process.env.SHORT_TITLE || 'Christmas', useCDN: yesNo.parse(process.env.USE_CDN || true), wishlist: require('./wishlist'), - base: (process.env.ROOT_PATH || '/').endsWith('/') ? (process.env.ROOT_PATH || '/') : `${process.env.ROOT_PATH}/` + base: (process.env.ROOT_PATH || '/').endsWith('/') ? (process.env.ROOT_PATH || '/') : `${process.env.ROOT_PATH}/`, + trustProxy: process.env.TRUST_PROXY === 'true' ? true : process.env.TRUST_PROXY || 'loopback' }; diff --git a/index.js b/index.js index 7de6ba4..abc7be3 100644 --- a/index.js +++ b/index.js @@ -16,6 +16,7 @@ const logger = require('./logger'); const app = express(); app.set('base', config.base) +app.set('trust proxy', config.trustProxy) const db = new PouchDB(config.dbUrl); diff --git a/package.json b/package.json index b4aa755..87b0c60 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "christmas-community", - "version": "1.14.0", + "version": "1.15.0", "description": "Christmas lists for communities", "main": "main.js", "scripts": {