Cap max size of federated repo list at 2048 bytes

This commit is contained in:
erik 2024-03-21 12:18:29 +01:00
parent 6055b4fca0
commit f327c0da24
2 changed files with 10 additions and 1 deletions

View file

@ -157,6 +157,10 @@ func IsValidFederatedRepoURLList(urls string) bool {
return true
}
func IsOfValidLength(str string) bool {
return len(str) <= 2048
}
var (
validUsernamePatternWithDots = regexp.MustCompile(`^[\da-zA-Z][-.\w]*$`)
validUsernamePatternWithoutDots = regexp.MustCompile(`^[\da-zA-Z][-\w]*$`)