mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-19 08:33:23 +02:00
Remove or clause for sessionId where "none" is offered as an alternative.
In the first case (line 16) we already know that req.query.sessionId is set to something. I n the second (line 40), it doesn't matter because if it doesn't map to a transport no further action is taken.
This commit is contained in:
@@ -13,7 +13,7 @@ app.get("/sse", async (req, res) => {
|
||||
const { server, cleanup } = createServer();
|
||||
|
||||
if (req?.query?.sessionId) {
|
||||
const sessionId = (req?.query?.sessionId as string) || "none";
|
||||
const sessionId = (req?.query?.sessionId as string);
|
||||
transport = transports.get(sessionId) as SSEServerTransport;
|
||||
console.error("Client Reconnecting? This shouldn't happen; when client has a sessionId, GET /sse should not be called again.", transport.sessionId);
|
||||
} else {
|
||||
@@ -37,7 +37,7 @@ app.get("/sse", async (req, res) => {
|
||||
});
|
||||
|
||||
app.post("/message", async (req, res) => {
|
||||
const sessionId = (req?.query?.sessionId as string) || "none";
|
||||
const sessionId = (req?.query?.sessionId as string);
|
||||
const transport = transports.get(sessionId);
|
||||
if (transport) {
|
||||
console.error("Client Message from", sessionId);
|
||||
|
||||
Reference in New Issue
Block a user