Skip to content

fix(webui): drop 303 redirects on navigation - #38

Merged
Jmmt-mingrui merged 1 commit into
mainfrom
fix/webui-no-303-redirect
Aug 27, 2026
Merged

Jmmt-mingrui merged 1 commit into
mainfrom
fix/webui-no-303-redirect

Conversation

@Jmmt-mingrui

Copy link
Copy Markdown
Contributor

What

Removes the 303 redirect hops on Web UI navigation (/mcp/web):

  • Unauthenticated browser requests to web routes now render the login page directly (200) instead of 303-redirecting to /mcp/web/login.
  • /mcp/web home now renders the models page directly (200) instead of 303-redirecting to /mcp/web/models.
  • The login form posts to a fixed /mcp/web/login action so the login page works when served from any path (e.g. directly at /mcp/web).

Why

Previously every browser visit without a valid session (and every visit to /mcp/web) produced a 303, which showed up as noisy redirect traffic in the logs and round-tripped the browser an extra hop.

What is intentionally kept

  • Post-login PRG 303 to /mcp/web (prevents form resubmission on refresh).
  • Post-action PRG 303s (validate / commit / discard / upload / workspace create-delete).
  • JSON API auth unchanged: unauthenticated non-browser requests still return 401 JSON.

Verification

Smoke-tested the constructed app with a Starlette TestClient:

  • GET /mcp/web (browser, no auth) → 200 login page (was 303)
  • GET /mcp/web/models (browser, no auth) → 200 login page
  • GET /mcp/web/semantic/files (json, no auth) → 401 JSON (unchanged)
  • No navigation route returns 303

🤖 Generated with Claude Code

Unauthenticated browser requests to web routes now render the login page
directly (200) instead of 303-redirecting to /mcp/web/login, and the
/mcp/web home route renders the models page directly instead of
redirecting to /mcp/web/models. The login form posts to a fixed
/mcp/web/login action so it works when served from any path.

Post-login and post-action PRG redirects (303) are kept, as is JSON API
auth (unauthenticated non-browser requests still return 401).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jmmt-mingrui
Jmmt-mingrui merged commit db071d0 into main Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant