Skip to content

Commit 37fc7d2

Browse files
committed
fix check to skip session validation for stateless mode
1 parent a51fea3 commit 37fc7d2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/server/streamableHttp.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ describe("StreamableHTTPServerTransport", () => {
288288
});
289289
});
290290

291-
it("should reject requests without a valid session ID", async () => {
291+
it.only("should reject requests without a valid session ID", async () => {
292292
const response = await sendPostRequest(baseUrl, TEST_MESSAGES.toolsList);
293293

294294
expect(response.status).toBe(400);

src/server/streamableHttp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,8 @@ export class StreamableHTTPServerTransport implements Transport {
463463
* Returns true if the session is valid, false otherwise
464464
*/
465465
private validateSession(req: IncomingMessage, res: ServerResponse): boolean {
466-
if (this.sessionId === undefined) {
467-
// If the session ID is not set, the session management is disabled
466+
if (this.sessionIdGenerator === undefined) {
467+
// If the sessionIdGenerator ID is not set, the session management is disabled
468468
// and we don't need to validate the session ID
469469
return true;
470470
}

0 commit comments

Comments
 (0)