From 54ed5a4eb518184b8f633bc3f2c9be99b8b35e84 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Sat, 30 May 2026 20:00:33 -0700 Subject: [PATCH] fix(e2e): tolerate trailing slash in SERVER_ROOT_PATH login redirect (#29369) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Next.js admin UI is exported with trailingSlash: true, so the proxy serves /ui/login at /ui/login/index.html and 308s /ui/login → /ui/login/. The waitForURL predicate used endsWith("/ui/login"), which never matched the canonicalized URL and timed out after 15s. This was masked until the build artifacts were regenerated against the AuthContext fix: the prior bundles still hit the racy redirect path that fired before proxyBaseUrl was populated, producing /ui/login (no prefix, no proxy round-trip, no trailing slash) which fortuitously satisfied the predicate. The first PR to ship the corrected bundle exposed the assertion bug. Switch the predicate to includes("/ui/login"); the prefix assertion below still validates the SERVER_ROOT_PATH preservation that is the actual contract under test. --- .../e2e_tests/tests/login/serverRootPathRedirect.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/litellm-dashboard/e2e_tests/tests/login/serverRootPathRedirect.spec.ts b/ui/litellm-dashboard/e2e_tests/tests/login/serverRootPathRedirect.spec.ts index 62a3e91318..bdef8f85c4 100644 --- a/ui/litellm-dashboard/e2e_tests/tests/login/serverRootPathRedirect.spec.ts +++ b/ui/litellm-dashboard/e2e_tests/tests/login/serverRootPathRedirect.spec.ts @@ -26,7 +26,7 @@ test("unauth redirect preserves SERVER_ROOT_PATH prefix", async ({ page }) => { await page.goto(`http://localhost:4000${ROOT_PATH}/ui/?page=virtual-keys`); - await page.waitForURL((url) => url.pathname.endsWith("/ui/login"), { timeout: 15_000 }); + await page.waitForURL((url) => url.pathname.includes("/ui/login"), { timeout: 15_000 }); expect(page.url()).toContain(`${ROOT_PATH}/ui/login`); });