Skip to content

Commit 4aaa26d

Browse files
committed
remove protocol version mismatch warning
1 parent 4e9d6a7 commit 4aaa26d

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

src/server/streamableHttp.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ describe("StreamableHTTPServerTransport", () => {
791791
expectErrorResponse(errorData, -32000, /Bad Request: Unsupported protocol version \(supported versions: .+\)/);
792792
});
793793

794-
it("should accept but warn when protocol version differs from negotiated version", async () => {
794+
it("should accept when protocol version differs from negotiated version", async () => {
795795
sessionId = await initializeServer();
796796

797797
// Spy on console.warn to verify warning is logged
@@ -812,11 +812,6 @@ describe("StreamableHTTPServerTransport", () => {
812812
// Request should still succeed
813813
expect(response.status).toBe(200);
814814

815-
// But warning should have been logged
816-
expect(warnSpy).toHaveBeenCalledWith(
817-
expect.stringContaining("Request has header with protocol version 2024-11-05, but version previously negotiated is 2025-03-26")
818-
);
819-
820815
warnSpy.mockRestore();
821816
});
822817

src/server/streamableHttp.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,6 @@ export class StreamableHTTPServerTransport implements Transport {
543543
protocolVersion = protocolVersion[protocolVersion.length - 1];
544544
}
545545

546-
547-
if (this.protocolVersion !== undefined && this.protocolVersion !== protocolVersion) {
548-
console.warn(`Request has header with protocol version ${protocolVersion}, but version previously negotiated is ${this.protocolVersion}.`);
549-
}
550546
if (!SUPPORTED_PROTOCOL_VERSIONS.includes(protocolVersion)) {
551547
res.writeHead(400).end(JSON.stringify({
552548
jsonrpc: "2.0",

0 commit comments

Comments
 (0)