Skip to content

Commit

Permalink
Fix code scanning alert no. 518: Inefficient regular expression
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent d0af5fb commit 0c4ed2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/config-manage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const validators = {
},

hostname: (value: string): ValidatorResponse => {
const hostnameRegex = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]).)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/;
const hostnameRegex = /^([a-zA-Z0-9](-?[a-zA-Z0-9])*\.)*[a-zA-Z0-9](-?[a-zA-Z0-9])*$/;
return {
isValid: hostnameRegex.test(value),
message: 'Invalid hostname format',
Expand Down

0 comments on commit 0c4ed2a

Please sign in to comment.