Range-diff rd-29
- title
- chore(pgs): add validation to project names
- description
-
Patch changed - old #1
3bd44da- new #1
9002592
1: 3bd44da ! 1: 9002592 chore(pgs): add validation to project names
old
old:
shared/bucket.go
new:shared/bucket.go
return fmt.Sprintf("static-%s", userID) } +func ValidateProjectName(projectName string) error { + if projectName == "pico-private" { + return fmt.Errorf("%s is an invalid project name", projectName) + } + return nil +} + func GetProjectName(entry *utils.FileEntry) string { if entry.Mode.IsDir() && strings.Count(entry.Filepath, string(os.PathSeparator)) == 0 { return entry.Filepath
new
old:
shared/bucket.go
new:shared/bucket.go
return fmt.Sprintf("static-%s", userID) } +func ValidateProjectName(projectName string) error { + if projectName == "pico-private" || projectName == "pico-imgs" { + return fmt.Errorf("%s is an invalid project name", projectName) + } + return nil +} + func GetProjectName(entry *utils.FileEntry) string { if entry.Mode.IsDir() && strings.Count(entry.Filepath, string(os.PathSeparator)) == 0 { return entry.Filepath