From c87e8ee70b4bcce32482eb23091e3fb53664ad1b Mon Sep 17 00:00:00 2001 From: Clemens Moritz Date: Tue, 18 Apr 2023 21:45:55 +0200 Subject: [PATCH] Make trust proxy option configurable trust proxy option is now configurable via the TRUST_PROXY_IP environment variable. --- backend/src/app.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/app.ts b/backend/src/app.ts index a5f0d96..c962c46 100644 --- a/backend/src/app.ts +++ b/backend/src/app.ts @@ -4,11 +4,11 @@ import morgan from 'morgan'; import router from './router'; import wxService from './services/wx.service'; -const { PORT = 3000, BASE_PATH = '/api' } = process.env; +const { PORT = 3000, BASE_PATH = '/api', TRUST_PROXY_IP = false } = process.env; const app = express(); -app.set('trust proxy', true); +app.set('trust proxy', TRUST_PROXY_IP); app.use(morgan('combined')); app.use(BASE_PATH, router.router);