mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-08 18:04:14 +01:00
adjust fed repo splitting
This commit is contained in:
parent
7a142c876e
commit
5671566df6
1 changed files with 4 additions and 4 deletions
|
@ -194,7 +194,7 @@ func SettingsPost(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
federationRepos := form.FederationRepos
|
||||
federationRepos := strings.TrimSpace(form.FederationRepos)
|
||||
|
||||
maxFederatedRepoStrLength := 2048
|
||||
errs := validation.ValidateMaxLen(federationRepos, maxFederatedRepoStrLength, "federationRepos")
|
||||
|
@ -205,9 +205,9 @@ func SettingsPost(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
federationRepoSplit := strings.Split(federationRepos, ";")
|
||||
if strings.TrimSpace(federationRepos) == "" {
|
||||
federationRepoSplit = []string{}
|
||||
federationRepoSplit := []string{}
|
||||
if federationRepos != "" {
|
||||
federationRepoSplit = strings.Split(federationRepos, ";")
|
||||
}
|
||||
for idx, repo := range federationRepoSplit {
|
||||
federationRepoSplit[idx] = strings.TrimSpace(repo)
|
||||
|
|
Loading…
Reference in a new issue