Skip to content

Commit

Permalink
fix(common): enforce string type in validationpipe
Browse files Browse the repository at this point in the history
strictly parse the value to string to avoid nested objects being passed if the type is explicitly set to string

closes #14234
  • Loading branch information
LhonRafaat committed Nov 28, 2024
1 parent d220da6 commit a071a73
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/common/pipes/validation.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ export class ValidationPipe implements PipeTransform<any> {
if (metatype === Number) {
return +value;
}
if (metatype === String) {
return String(value);
}
return value;
}

Expand Down

0 comments on commit a071a73

Please sign in to comment.