From 2c05ceaf504915b51cf8770cc14692499e7f2c87 Mon Sep 17 00:00:00 2001 From: martyfuhry Date: Wed, 31 Jul 2024 14:09:30 -0400 Subject: [PATCH] fix(server): external domain url validation (#11493) * fix(web): Changes externalDomain to IsUrl() * refactor(web): asset viewer actions (#11449) * refactor(web): asset viewer actions * motion photo slot and more refactoring fix(web): Changes externalDomain to IsUrl() --------- Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> --- server/src/dtos/system-config.dto.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/dtos/system-config.dto.ts b/server/src/dtos/system-config.dto.ts index 98acb495ce..e2255223d0 100644 --- a/server/src/dtos/system-config.dto.ts +++ b/server/src/dtos/system-config.dto.ts @@ -376,7 +376,8 @@ class SystemConfigReverseGeocodingDto { } class SystemConfigServerDto { - @IsString() + @ValidateIf((_, value: string) => value !== '') + @IsUrl({ require_tld: false, require_protocol: true, protocols: ['http', 'https'] }) externalDomain!: string; @IsString()