fix: It is now validated if the instance name contains uppercase and special characters

This commit is contained in:
Davidson Gomes
2023-07-21 12:26:43 -03:00
parent 897f8164b9
commit d7f264c1c2
3 changed files with 7 additions and 2 deletions

View File

@@ -42,6 +42,12 @@ export class InstanceController {
}: InstanceDto) {
this.logger.verbose('requested createInstance from ' + instanceName + ' instance');
if (instanceName !== instanceName.toLowerCase().replace(/[^a-z0-9]/g, '')) {
throw new BadRequestException(
'The instance name must be lowercase and without special characters',
);
}
const mode = this.configService.get<Auth>('AUTHENTICATION').INSTANCE.MODE;
if (mode === 'container') {