From c36573571dcf0c6d18ffe4d614dc16b29aac5a4d Mon Sep 17 00:00:00 2001 From: JGiter Date: Mon, 3 Apr 2023 11:51:27 +0300 Subject: [PATCH] chore: allow cors without tld --- src/common/cors.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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`); } }