Skip to content

fix(cli): remove unnecessary cors headers from mcp endpoint#2074

Merged
bpamiri merged 1 commit into
developfrom
peter/mcp-cors-header-fix
Apr 10, 2026
Merged

fix(cli): remove unnecessary cors headers from mcp endpoint#2074
bpamiri merged 1 commit into
developfrom
peter/mcp-cors-header-fix

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Apr 10, 2026

Summary

  • Remove static CORS headers (Access-Control-Allow-Origin, Allow-Methods, Allow-Headers) from the MCP endpoint — they are redundant since the endpoint is already restricted to localhost via cgi.REMOTE_ADDR check
  • Change OPTIONS handler from 200 OK (CORS preflight) to 405 Method Not Allowed since CORS is no longer supported

Test plan

  • Verify CORS headers no longer appear on MCP responses
  • Verify OPTIONS requests return 405 with JSON error body
  • Run full test suite (2661 pass, 6 pre-existing failures unrelated to this change)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant