test(config): pin splitCSV whitespace and empty-entry handling
This commit is contained in:
@@ -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, []string{"https://claude.ai", "https://api.anthropic.com"}, cfg.OriginAllowlist)
|
||||||
assert.Equal(t, "9000", cfg.Port)
|
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)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user