Skip to content

Commit

Permalink
fix(server): add regex for environment name (#944)
Browse files Browse the repository at this point in the history
Signed-off-by: maslow <wangfugen@126.com>
  • Loading branch information
maslow authored Mar 21, 2023
1 parent d62fe96 commit 1f5c300
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/src/application/dto/create-env.dto.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ApiProperty } from '@nestjs/swagger'
import { IsNotEmpty, IsString, Length } from 'class-validator'
import { IsNotEmpty, IsString, Length, Matches } from 'class-validator'

export class CreateEnvironmentDto {
@ApiProperty()
@IsNotEmpty()
@IsString()
@Length(1, 64)
@Matches(/^[a-zA-Z_][a-zA-Z0-9_]*$/)
name: string

@ApiProperty()
Expand Down

0 comments on commit 1f5c300

Please sign in to comment.