From 034032a3167ab09ea62dfe0c3e3d3e62a5d78c72 Mon Sep 17 00:00:00 2001 From: Nevo David Date: Thu, 23 Oct 2025 11:23:53 +0700 Subject: [PATCH] feat: ignore query string --- libraries/helpers/src/utils/valid.url.path.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/helpers/src/utils/valid.url.path.ts b/libraries/helpers/src/utils/valid.url.path.ts index 469f8229..fbcc0069 100644 --- a/libraries/helpers/src/utils/valid.url.path.ts +++ b/libraries/helpers/src/utils/valid.url.path.ts @@ -8,11 +8,11 @@ import { export class ValidUrlExtension implements ValidatorConstraintInterface { validate(text: string, args: ValidationArguments) { return ( - text?.endsWith('.png') || - text?.endsWith('.jpg') || - text?.endsWith('.jpeg') || - text?.endsWith('.gif') || - text?.endsWith('.mp4') + !!text?.split?.('?')?.[0].endsWith('.png') || + !!text?.split?.('?')?.[0].endsWith('.jpg') || + !!text?.split?.('?')?.[0].endsWith('.jpeg') || + !!text?.split?.('?')?.[0].endsWith('.gif') || + !!text?.split?.('?')?.[0].endsWith('.mp4') ); }