Skip to content

Commit 09403fe

Browse files
authoredMar 29, 2025
Update server.ts
1 parent 6cccf54 commit 09403fe

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed
 

Diff for: ‎src/transports/http/server.ts

-4
Original file line numberDiff line numberDiff line change
@@ -241,18 +241,14 @@ export class HttpStreamTransport extends AbstractTransport {
241241
throw this.httpError(400, `Bad Request: ${e.message}`, -32700, undefined, firstRequestId);
242242
}
243243

244-
// Find initialize requests and validate batching
245244
const initializeRequests = parsedMessages.filter(msg => isRequest(msg) && msg.method === 'initialize');
246245

247-
// Check if initialize request is present
248246
if (initializeRequests.length > 0) {
249-
// If we have an initialize request, verify it's not batched with other requests
250247
if (initializeRequests.length > 1) {
251248
logger.error("Multiple initialize requests in the same batch");
252249
throw this.httpError(400, "Bad Request: Multiple initialize requests in the same batch", -32600, undefined, firstRequestId);
253250
}
254251

255-
// If initialize is present and the batch contains more than 1 message, reject it
256252
if (parsedMessages.length > 1) {
257253
logger.error("Initialize request cannot be batched with other requests");
258254
throw this.httpError(400, "Bad Request: Initialize request must not be part of a JSON-RPC batch", -32600, undefined, firstRequestId);

0 commit comments

Comments
 (0)
Please sign in to comment.