From 51a9f9c9f8b3a41b875a5c33ac7751cd28f2da7a Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 19 Feb 2026 15:29:55 +0100 Subject: [PATCH] fix: fix API_URL trailing slash and remove CORS env var overrides in test:e2e MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The API_URL needs a trailing slash so Playwright resolves relative URLs correctly (e.g. "test/users" → "/api/v1/test/users" instead of "/api/test/users"). CORS env vars are removed because Viper parses comma-separated env vars as a single string instead of a slice, breaking origin matching. The defaults already include the correct patterns. --- magefile.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/magefile.go b/magefile.go index 3eef5c87a..8abab4f0b 100644 --- a/magefile.go +++ b/magefile.go @@ -484,8 +484,6 @@ func (Test) E2E(args string) error { "VIKUNJA_LOG_LEVEL=WARNING", "VIKUNJA_MAILER_ENABLED=false", "VIKUNJA_REDIS_ENABLED=false", - "VIKUNJA_CORS_ENABLE=true", - "VIKUNJA_CORS_ORIGINS=http://127.0.0.1:*,http://localhost:*", ) apiCmd.Stdout = os.Stdout apiCmd.Stderr = os.Stderr @@ -546,7 +544,7 @@ func (Test) E2E(args string) error { playwrightCmd := exec.Command("pnpm", playwrightArgs...) playwrightCmd.Dir = "frontend" playwrightCmd.Env = append(os.Environ(), - fmt.Sprintf("API_URL=%s", apiBase), + fmt.Sprintf("API_URL=%s/", apiBase), fmt.Sprintf("BASE_URL=%s", frontendBase), fmt.Sprintf("VIKUNJA_SERVICE_TESTINGTOKEN=%s", testingToken), fmt.Sprintf("TEST_SECRET=%s", testingToken),