Skip to content

Commit

Permalink
fix(api): correctly count length of name in alerts via utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
Satont committed Sep 6, 2023
1 parent 2f5bf65 commit ef8a9e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/api/internal/impl_protected/alerts/alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (c *Alerts) AlertsUpdate(ctx context.Context, req *alerts.UpdateRequest) (
*alerts.Alert,
error,
) {
if len(req.Name) > 30 {
if utf8.RuneCountInString(req.Name) > 30 {
return nil, twirp.NewError(twirp.OutOfRange, "Alert name is too long")
}

Expand Down

0 comments on commit ef8a9e6

Please sign in to comment.