From 87cbce27a19c6000c4812e33c5b65e7b2b40514a Mon Sep 17 00:00:00 2001 From: Mathias Bergqvist Date: Mon, 4 May 2026 20:25:28 +0200 Subject: [PATCH] test(config): pin splitCSV whitespace and empty-entry handling --- internal/config/config_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 29f6baf..32ae3dc 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -36,3 +36,11 @@ func TestLoadFromEnv(t *testing.T) { assert.Equal(t, []string{"https://claude.ai", "https://api.anthropic.com"}, cfg.OriginAllowlist) assert.Equal(t, "9000", cfg.Port) } + +func TestLoadCSVTrimsWhitespaceAndDropsEmpty(t *testing.T) { + t.Setenv("GITEA_MCP_ALLOWED_OWNERS", " mathias , , acme ") + + cfg, err := config.Load() + require.NoError(t, err) + assert.Equal(t, []string{"mathias", "acme"}, cfg.AllowedOwners) +}