diff --git a/src/common/cors.config.ts b/src/common/cors.config.ts index b6f4d4dc..0acf07dd 100644 --- a/src/common/cors.config.ts +++ b/src/common/cors.config.ts @@ -6,7 +6,7 @@ export function corsConfig(app: INestApplication) { const configService = app.get(ConfigService); const allowedOrigins = configService.get('ALLOWED_ORIGINS').split(','); for (const origin of allowedOrigins) { - if (!isURL(origin)) { + if (!isURL(origin, { require_tld: false })) { throw new Error(`Origin ${origin} is not a valid URL`); } }