This commit is contained in:
2026-07-09 09:02:22 +03:00
parent 653eaecf2e
commit 43821c791c
+2 -2
View File
@@ -66,7 +66,7 @@ async function runSSE() {
const url = new URL(req.url || "/", `http://${req.headers.host}`); const url = new URL(req.url || "/", `http://${req.headers.host}`);
if (req.method === "GET") { if (req.method === "GET") {
const transport = new SSEServerTransport("/message", res); const transport = new SSEServerTransport("/sse", res);
const server = buildServer(); const server = buildServer();
await server.connect(transport); await server.connect(transport);
@@ -77,7 +77,7 @@ async function runSSE() {
return; return;
} }
if (req.method === "POST" && url.pathname === "/message") { if (req.method === "POST" && url.pathname === "/sse") {
const sessionId = url.searchParams.get("sessionId") || ""; const sessionId = url.searchParams.get("sessionId") || "";
const transport = transports.get(sessionId); const transport = transports.get(sessionId);
if (!transport) { if (!transport) {