Repository navigation
fix(webui): drop 303 redirects on navigation - #38
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the 303 redirect hops on Web UI navigation (
/mcp/web):/mcp/web/login./mcp/webhome now renders the models page directly (200) instead of 303-redirecting to/mcp/web/models./mcp/web/loginaction 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
/mcp/web(prevents form resubmission on refresh).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 pageGET /mcp/web/semantic/files(json, no auth) → 401 JSON (unchanged)🤖 Generated with Claude Code