diff --git a/api/script/default-server.ts b/api/script/default-server.ts index d6b0e6f0d..f149e33fe 100644 --- a/api/script/default-server.ts +++ b/api/script/default-server.ts @@ -67,6 +67,9 @@ export function start(done: (err?: any, server?: express.Express, storage?: Stor // First, to wrap all requests and catch all exceptions. app.use(domain); + // Saboor Changes + app.set('trust proxy', 1); + // Monkey-patch res.send and res.setHeader to no-op after the first call and prevent "already sent" errors. app.use((req: express.Request, res: express.Response, next: (err?: any) => void): any => { const originalSend = res.send;