Repository navigation
docs(api): say what Config.Fallback receives after unmatchedAPIRoute - #673
Conversation
The #672 advisor found the Fallback comment stale: since #672, an unmatched /api/ path gets unmatchedAPIRoute's problem body, so Fallback sees only paths outside /api/. The serve command never set Fallback. _Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high_ Change-Id: Ib929048a31e6ab93da7c7983da9da5165069c78f Signed-off-by: Thomas Kosiewski <tk@coder.com>
|
@codex review |
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c96395c671
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Fallback (optional) receives every request outside /api/: an unmatched | ||
| // /api/ path gets unmatchedAPIRoute's problem body. The serve command does |
There was a problem hiding this comment.
Account for ServeMux redirects in the fallback contract
When a caller sets Fallback and requests /api (or an unclean path such as /x/../api/foo), http.ServeMux performs its trailing-slash or path-cleaning redirect before selecting the / handler, so Fallback never receives that request. The repository already identifies /api as this redirect case in cmd/openstorage/metrics_surface_test.go:20; therefore “every request outside /api/” remains inaccurate and should be limited to clean, non-redirected paths.
Useful? React with 👍 / 👎.
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Codex round 1 on #673: ServeMux redirects /api and unclean paths before it picks the / handler, so Fallback never sees them. Change-Id: I81dd6477fb76312cd249b5e92c950935b59206ce Signed-off-by: Thomas Kosiewski <tk@coder.com>
Change-Id: I847fec0f8c1aa34e8f9c864d1deffcfcfbdf2205 Signed-off-by: Thomas Kosiewski <tk@coder.com>
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
The
api.Config.Fallbackcomment now says what the field receives: every request outside/api/. This is a follow-up from the merge advisor on #672.Why
The comment said Fallback "receives every request not matching an /api/v1 route" and that "the serve command mounts the git smart-HTTP handler there". Both statements are wrong:
unmatchedAPIRouteis registered for/api/(internal/api/api.go), so an unmatched/api/path gets its problem body and never reaches Fallback./api/in its own mux, next to the git smart-HTTP handler (cmd/openstorage/main.go).Change
Comment only, no behavior change.
Validation
go build ./internal/api,golangci-lint run ./internal/api/...(0 issues), andgo test ./internal/api -run 'Fallback|Unmatched'pass.Refs #352
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high