add supported versions to error message

This commit is contained in:
Olivier Chafik 2025-06-12 18:42:51 +01:00
commit bb0592bd50
No known key found for this signature in database

View file

@ -788,7 +788,7 @@ describe("StreamableHTTPServerTransport", () => {
expect(response.status).toBe(400);
const errorData = await response.json();
expectErrorResponse(errorData, -32000, /Bad Request: Unsupported protocol version/);
expectErrorResponse(errorData, -32000, /Bad Request: Unsupported protocol version \(supported versions: .+\)/);
});
it("should accept but warn when protocol version differs from negotiated version", async () => {
@ -835,7 +835,7 @@ describe("StreamableHTTPServerTransport", () => {
expect(response.status).toBe(400);
const errorData = await response.json();
expectErrorResponse(errorData, -32000, /Bad Request: Unsupported protocol version/);
expectErrorResponse(errorData, -32000, /Bad Request: Unsupported protocol version \(supported versions: .+\)/);
});
it("should handle protocol version validation for DELETE requests", async () => {
@ -852,7 +852,7 @@ describe("StreamableHTTPServerTransport", () => {
expect(response.status).toBe(400);
const errorData = await response.json();
expectErrorResponse(errorData, -32000, /Bad Request: Unsupported protocol version/);
expectErrorResponse(errorData, -32000, /Bad Request: Unsupported protocol version \(supported versions: .+\)/);
});
});
});