fix check to skip session validation for stateless mode

This commit is contained in:
ihrpr 2025-04-21 14:56:12 +01:00
commit 37fc7d2ca8
No known key found for this signature in database

View file

@ -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;
}