fix check to skip session validation for stateless mode
This commit is contained in:
parent
a51fea33b1
commit
37fc7d2ca8
2 changed files with 3 additions and 3 deletions
|
|
@ -288,7 +288,7 @@ describe("StreamableHTTPServerTransport", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("should reject requests without a valid session ID", async () => {
|
||||
it.only("should reject requests without a valid session ID", async () => {
|
||||
const response = await sendPostRequest(baseUrl, TEST_MESSAGES.toolsList);
|
||||
|
||||
expect(response.status).toBe(400);
|
||||
|
|
|
|||
|
|
@ -463,8 +463,8 @@ export class StreamableHTTPServerTransport implements Transport {
|
|||
* Returns true if the session is valid, false otherwise
|
||||
*/
|
||||
private validateSession(req: IncomingMessage, res: ServerResponse): boolean {
|
||||
if (this.sessionId === undefined) {
|
||||
// If the session ID is not set, the session management is disabled
|
||||
if (this.sessionIdGenerator === undefined) {
|
||||
// If the sessionIdGenerator ID is not set, the session management is disabled
|
||||
// and we don't need to validate the session ID
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue