fix: correct regex for invalid app names
This commit is contained in:
1 parent
76c0aed2ad
commit
7fd1882dbb
1 file changed
+2
-2
@@ -573,7 +573,7 @@ func IsValidAppName(appName string) error {
|
|||||||
return fmt.Errorf("APP must not be null")
|
return fmt.Errorf("APP must not be null")
|
||||||
}
|
}
|
||||||
|
|
||||||
r, _ := regexp.Compile("^[a-z0-9].*")
|
r, _ := regexp.Compile("^[a-z0-9][^:A-Z]*$")
|
||||||
if r.MatchString(appName) {
|
if r.MatchString(appName) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -583,7 +583,7 @@ func IsValidAppName(appName string) error {
|
|||||||
os.RemoveAll(appRoot)
|
os.RemoveAll(appRoot)
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors.New("App name must begin with lowercase alphanumeric character")
|
return errors.New("App name must begin with lowercase alphanumeric character, and cannot include uppercase characters or colons")
|
||||||
}
|
}
|
||||||
|
|
||||||
// VerifyAppName verifies app name format and app existence"
|
// VerifyAppName verifies app name format and app existence"
|
||||||
|
|||||||
Reference in new issue
Block a user