From bd7294ca32e4568f8b5dff1fa187610cd49d10d5 Mon Sep 17 00:00:00 2001 From: Gabriel Pastori <58153955+gabrielpastori1@users.noreply.github.com> Date: Sat, 9 Sep 2023 15:38:07 +0000 Subject: [PATCH] fix: default options to CORS_ORIGIN and CORS_METHODS --- src/config/env.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/env.config.ts b/src/config/env.config.ts index fe2431fd..13fe19c4 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -183,8 +183,8 @@ export class ConfigService { HIDE_MANAGER: process.env?.SERVER_HIDE_MANAGER === 'true', }, CORS: { - ORIGIN: process.env.CORS_ORIGIN.split(',') || ['*'], - METHODS: (process.env.CORS_METHODS.split(',') as HttpMethods[]) || ['POST', 'GET', 'PUT', 'DELETE'], + ORIGIN: process.env.CORS_ORIGIN?.split(',') || ['*'], + METHODS: (process.env.CORS_METHODS?.split(',') as HttpMethods[]) || ['POST', 'GET', 'PUT', 'DELETE'], CREDENTIALS: process.env?.CORS_CREDENTIALS === 'true', }, SSL_CONF: {