remove protocol version mismatch warning
This commit is contained in:
parent
4e9d6a707d
commit
4aaa26d900
2 changed files with 1 additions and 10 deletions
|
|
@ -791,7 +791,7 @@ describe("StreamableHTTPServerTransport", () => {
|
|||
expectErrorResponse(errorData, -32000, /Bad Request: Unsupported protocol version \(supported versions: .+\)/);
|
||||
});
|
||||
|
||||
it("should accept but warn when protocol version differs from negotiated version", async () => {
|
||||
it("should accept when protocol version differs from negotiated version", async () => {
|
||||
sessionId = await initializeServer();
|
||||
|
||||
// Spy on console.warn to verify warning is logged
|
||||
|
|
@ -812,11 +812,6 @@ describe("StreamableHTTPServerTransport", () => {
|
|||
// Request should still succeed
|
||||
expect(response.status).toBe(200);
|
||||
|
||||
// But warning should have been logged
|
||||
expect(warnSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining("Request has header with protocol version 2024-11-05, but version previously negotiated is 2025-03-26")
|
||||
);
|
||||
|
||||
warnSpy.mockRestore();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -543,10 +543,6 @@ export class StreamableHTTPServerTransport implements Transport {
|
|||
protocolVersion = protocolVersion[protocolVersion.length - 1];
|
||||
}
|
||||
|
||||
|
||||
if (this.protocolVersion !== undefined && this.protocolVersion !== protocolVersion) {
|
||||
console.warn(`Request has header with protocol version ${protocolVersion}, but version previously negotiated is ${this.protocolVersion}.`);
|
||||
}
|
||||
if (!SUPPORTED_PROTOCOL_VERSIONS.includes(protocolVersion)) {
|
||||
res.writeHead(400).end(JSON.stringify({
|
||||
jsonrpc: "2.0",
|
||||
|
|
|
|||
Loading…
Reference in a new issue