1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-21 08:31:27 -05:00

adjust fed repo splitting

This commit is contained in:
Clemens 2024-04-03 09:53:19 +02:00
parent 7a142c876e
commit 5671566df6

View file

@ -194,7 +194,7 @@ func SettingsPost(ctx *context.Context) {
return return
} }
federationRepos := form.FederationRepos federationRepos := strings.TrimSpace(form.FederationRepos)
maxFederatedRepoStrLength := 2048 maxFederatedRepoStrLength := 2048
errs := validation.ValidateMaxLen(federationRepos, maxFederatedRepoStrLength, "federationRepos") errs := validation.ValidateMaxLen(federationRepos, maxFederatedRepoStrLength, "federationRepos")
@ -205,9 +205,9 @@ func SettingsPost(ctx *context.Context) {
return return
} }
federationRepoSplit := strings.Split(federationRepos, ";") federationRepoSplit := []string{}
if strings.TrimSpace(federationRepos) == "" { if federationRepos != "" {
federationRepoSplit = []string{} federationRepoSplit = strings.Split(federationRepos, ";")
} }
for idx, repo := range federationRepoSplit { for idx, repo := range federationRepoSplit {
federationRepoSplit[idx] = strings.TrimSpace(repo) federationRepoSplit[idx] = strings.TrimSpace(repo)