Walkthrough
OAuth and MCP HTTP authentication now accept bearer schemes with different capitalization. MCP HTTP rejection logs distinguish missing headers, unsupported schemes, empty bearer tokens, and unknown or expired tokens.
Changes: Bearer authentication
Layer / File(s) Summary OAuth bearer parsing
apps/server/src/auth/EnvironmentAuth.ts,apps/server/src/auth/McpOAuth.test.tsThe bearer token parser matches the scheme without regard to case. The OAuth test checks three capitalization variants. MCP HTTP authentication
apps/server/src/mcp/McpHttpServer.ts,apps/server/src/mcp/McpHttpServer.test.tsThe MCP HTTP server matches bearer schemes without regard to case and distinguishes rejection reasons in its logs. Tests cover accepted credentials, rejected authorization values, and warning messages. Priority: External image Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
juliusmarminge
Merge Risk: External image Minimal · up to abc94
Bearer schemes now accept different capitalization while preserving token contents. No merge-blocking risk remains identified.
Pre-merge checks: Passed 4
Check name Status Explanation Title check Passed The title "fix(mcp): accept case-insensitive bearer authentication" matches the main change. The summary says both the MCP middleware and the shared OAuth bearer parser now accept the Bearer scheme ca… Description check Passed The description follows the template sections: Problem, Change, Scope and approval, and Verification. It explains the RFC 9110 basis, the two parser fixes, and why both are needed. It links issue #237…Linked Issues check Passed The changes satisfy the coding requirements in [ #23710].McpHttpServermatches theBearerscheme case-insensitively and logs distinct reasons for a missing header, unsupported scheme, empty token,…Out of Scope Changes check Passed The changes remain within [ #23710]. Production changes modify the two required bearer checks and MCP rejection classification. Test changes verify the required behavior and preserve authentication beh…Full details: Title check
Explanation
The title "fix(mcp): accept case-insensitive bearer authentication" matches the main change. The summary says both the MCP middleware and the shared OAuth bearer parser now accept the Bearer scheme case-insensitively. The title does not mention the secondary change to rejection logging, which the description covers, but that is expected. It follows the conventional commit style the template recommends.
Full details: Description check
Explanation
The description follows the template sections: Problem, Change, Scope and approval, and Verification. It explains the RFC 9110 basis, the two parser fixes, and why both are needed. It links issue
#23710and invokes the obvious-bug exception with reasons. The verification section gives concrete test commands, observed results, and items not checked, such as the external ChatGPT connector. It also leaves the template's HTML comments in place, which is acceptable. The claim that the obvious-bug exception applies is for maintainers to decide, but the author gives a reasoned basis for it.
Full details: Linked Issues check
Explanation
The changes satisfy the coding requirements in [
#23710].McpHttpServermatches theBearerscheme case-insensitively and logs distinct reasons for a missing header, unsupported scheme, empty token, and unknown or expired token. The logs do not include the header or credential.EnvironmentAuthapplies the same scheme handling. The HTTP and OAuth tests cover scheme variants, rejected credentials, token case sensitivity, and diagnostic safety.
Full details: Out of Scope Changes check
Explanation
The changes remain within [
#23710]. Production changes modify the two required bearer checks and MCP rejection classification. Test changes verify the required behavior and preserve authentication behavior. No unrelated feature, dependency, setting, UI, or workflow changes are identified.
Finishing Touches
🧪 Generate unit tests (beta)
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.