mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
feat: Add serving applications on subdomains and port-based proxying (#3753)
Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
@ -8,8 +8,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
usernameValid = regexp.MustCompile("^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$")
|
||||
usernameReplace = regexp.MustCompile("[^a-zA-Z0-9-]*")
|
||||
UsernameValidRegex = regexp.MustCompile("^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$")
|
||||
usernameReplace = regexp.MustCompile("[^a-zA-Z0-9-]*")
|
||||
)
|
||||
|
||||
// UsernameValid returns whether the input string is a valid username.
|
||||
@ -20,7 +20,7 @@ func UsernameValid(str string) bool {
|
||||
if len(str) < 1 {
|
||||
return false
|
||||
}
|
||||
return usernameValid.MatchString(str)
|
||||
return UsernameValidRegex.MatchString(str)
|
||||
}
|
||||
|
||||
// UsernameFrom returns a best-effort username from the provided string.
|
||||
|
Reference in New Issue
Block a user