feat: ignore query string

This commit is contained in:
Nevo David 2025-10-23 11:23:53 +07:00
parent 0473c0f1af
commit 034032a316
1 changed files with 5 additions and 5 deletions

View File

@ -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')
);
}