From 4a2a5a7a4d260e5d4c61482c541b3de44c68821a Mon Sep 17 00:00:00 2001 From: Philip Okugbe <16838612+Philipinho@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:56:15 +0000 Subject: [PATCH] fix: postgres and redis url validation (#548) --- .../environment/environment.validation.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/server/src/integrations/environment/environment.validation.ts b/apps/server/src/integrations/environment/environment.validation.ts index 4f1bf563..cba438e6 100644 --- a/apps/server/src/integrations/environment/environment.validation.ts +++ b/apps/server/src/integrations/environment/environment.validation.ts @@ -11,14 +11,22 @@ import { plainToInstance } from 'class-transformer'; export class EnvironmentVariables { @IsNotEmpty() @IsUrl( - { protocols: ['postgres', 'postgresql'], require_tld: false }, + { + protocols: ['postgres', 'postgresql'], + require_tld: false, + allow_underscores: true, + }, { message: 'DATABASE_URL must be a valid postgres connection string' }, ) DATABASE_URL: string; @IsNotEmpty() @IsUrl( - { protocols: ['redis', 'rediss'], require_tld: false }, + { + protocols: ['redis', 'rediss'], + require_tld: false, + allow_underscores: true, + }, { message: 'REDIS_URL must be a valid redis connection string' }, ) REDIS_URL: string;