Sanitize NestJS Input in all the API Controllers #3797
Labels
Dev & Architecture
Development and Architecture
Technical Debt
Waiting
Waiting for other activity, requirement or deliverable before it can be actioned.
Milestone
Describe the task
Currently, the input received in the API controllers is handling validations by using decorators. But the sanitization of the received input is not happening. For example, input parameters like firstName, lastName etc (string) need to be trimmed before using them as a part of the logic in code.
One way to do this globally for all inputs across all controller endpoints could be to create global pipes like creating a
TrimPipe
to trim the inputs and likewise for other types of sanitizations as needed.Reference Links:
https://stackoverflow.com/questions/63766390/using-nest-js-i-would-like-to-trim-all-body-input-values
https://stackoverflow.com/questions/64313399/how-to-properly-sanitize-nestjs-input
The text was updated successfully, but these errors were encountered: