@@ -17,7 +17,7 @@ import cors from '@fastify/cors';
1717import multipart from '@fastify/multipart' ;
1818import { Logger } from 'nestjs-pino' ;
1919import cluster from 'node:cluster' ;
20- import { Environment } from './app/config' ;
20+ import { Config , Environment } from './app/config' ;
2121import { AppModule } from './app/app.module' ;
2222import { VALIDATION_PIPE_CONFIG } from './app/dto' ;
2323import { FIRST_WORKER_ENV_VAR } from './clustered' ;
@@ -30,9 +30,13 @@ async function bootstrap() {
3030 return this . toString ( ) ;
3131 } ;
3232
33+ const env : Environment = Config . env ;
34+
3335 const app = await NestFactory . create < NestFastifyApplication > (
3436 AppModule ,
35- new FastifyAdapter ( ) ,
37+ new FastifyAdapter ( {
38+ trustProxy : env === Environment . PRODUCTION
39+ } ) ,
3640 {
3741 bufferLogs : true , // Buffer logs until Pino is attached
3842 rawBody : true // So we can use RawBodyRequest
@@ -43,7 +47,6 @@ async function bootstrap() {
4347 app . useLogger ( app . get ( Logger ) ) ;
4448
4549 const configService = app . get ( ConfigService ) ;
46- const env : Environment = configService . getOrThrow ( 'env' ) ;
4750
4851 // Steam game auth and replay submission from game send raw octet-streams.
4952 // Steam auth we could limit to 2kb, but replays can be massive. Limiting
0 commit comments