mirror of
https://github.com/upstash/context7.git
synced 2025-11-24 14:08:35 +00:00
Correct CORS headers required for connecting from browser based MCP Clients
This commit is contained in:
parent
fe8f6e1e04
commit
31e659d63f
@ -213,7 +213,8 @@ async function main() {
|
|||||||
// Set CORS headers for all responses
|
// Set CORS headers for all responses
|
||||||
res.setHeader("Access-Control-Allow-Origin", "*");
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
||||||
res.setHeader("Access-Control-Allow-Methods", "GET,POST,OPTIONS,DELETE");
|
res.setHeader("Access-Control-Allow-Methods", "GET,POST,OPTIONS,DELETE");
|
||||||
res.setHeader("Access-Control-Allow-Headers", "Content-Type, MCP-Session-Id, mcp-session-id");
|
res.setHeader("Access-Control-Allow-Headers", "Content-Type, mcp-session-id");
|
||||||
|
res.setHeader("Access-Control-Expose-Headers", "MCP-Session-Id");
|
||||||
|
|
||||||
// Handle preflight OPTIONS requests
|
// Handle preflight OPTIONS requests
|
||||||
if (req.method === "OPTIONS") {
|
if (req.method === "OPTIONS") {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user