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

@ -6,6 +6,7 @@
* Correction in the use of the api with mongodb
* Adjustments to search endpoint for contacts, chats, messages and Status messages
* Now when deleting the instance, the data referring to it in mongodb is also deleted
* It is now validated if the instance name contains uppercase and special characters
# 1.3.1 (2023-07-20 07:48)

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') {

View File

@ -1412,8 +1412,6 @@ export class WAStartupService {
}
if (Number(countryCode) === 52 || Number(countryCode) === 54) {
console.log('numero mexicano');
const formattedMXARNumber = this.formatMXOrARNumber(number);
if (formattedMXARNumber !== number) {