Update internal/codespaces/rpc/invoker.go
Co-authored-by: Caleb Brose <5447118+cmbrose@users.noreply.github.com>
This commit is contained in:
parent
6d5a26cfd1
commit
a02f84528a
1 changed files with 1 additions and 1 deletions
|
|
@ -307,7 +307,7 @@ func (i *invoker) notifyCodespaceOfClientActivity(ctx context.Context, activity
|
|||
|
||||
func isUsernameValid(username string) bool {
|
||||
// assuming valid usernames are alphanumeric, with these special characters allowed: . _ -
|
||||
var validUsernamePattern = `^[a-zA-Z0-9._-]+$`
|
||||
var validUsernamePattern = `^[a-zA-Z0-9_][-.a-zA-Z0-9_]*$`
|
||||
re := regexp.MustCompile(validUsernamePattern)
|
||||
return re.MatchString(username)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue