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

Also trim whitespaces within the list items

This commit is contained in:
erik 2024-04-02 17:33:32 +02:00
parent 431b4c2829
commit 5edf7d0e61

View file

@ -209,6 +209,9 @@ func SettingsPost(ctx *context.Context) {
if strings.TrimSpace(federationRepos) == "" { if strings.TrimSpace(federationRepos) == "" {
federationRepoSplit = []string{} federationRepoSplit = []string{}
} }
for idx, repo := range federationRepoSplit {
federationRepoSplit[idx] = strings.TrimSpace(repo)
}
if _, _, err := federation.StoreFederatedRepoList(ctx, ctx.Repo.Repository.ID, federationRepoSplit); err != nil { if _, _, err := federation.StoreFederatedRepoList(ctx, ctx.Repo.Repository.ID, federationRepoSplit); err != nil {
ctx.ServerError("UpdateRepository", err) ctx.ServerError("UpdateRepository", err)