Update src/server/streamableHttp.ts
Co-authored-by: Cliff Hall <cliff@futurescale.com>
This commit is contained in:
parent
d88308bbfe
commit
0058c30032
1 changed files with 6 additions and 1 deletions
|
|
@ -463,7 +463,12 @@ export class StreamableHTTPServerTransport implements Transport {
|
|||
* Returns true if the session is valid, false otherwise
|
||||
*/
|
||||
private validateSession(req: IncomingMessage, res: ServerResponse): boolean {
|
||||
if (this.sessionId && !this._initialized) {
|
||||
if (this.sessionId === undefined) {
|
||||
// If the session ID is not set, the session management is disabled
|
||||
// and we don't need to validate the session ID
|
||||
return true;
|
||||
}
|
||||
if (!this._initialized) {
|
||||
// If the server has not been initialized yet, reject all requests
|
||||
res.writeHead(400).end(JSON.stringify({
|
||||
jsonrpc: "2.0",
|
||||
|
|
|
|||
Loading…
Reference in a new issue