fix: Use lowercase header names

This commit is contained in:
Geng Yan 2025-04-01 10:58:37 +08:00 • committed by ihrpr
commit 970cf9d5b1
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View file

@ -69,7 +69,7 @@ describe("StreamableHTTPServerTransport", () => {
expect(mockResponse.writeHead).toHaveBeenCalledWith(
200,
expect.objectContaining({
"Mcp-Session-Id": transport.sessionId,
"mcp-session-id": transport.sessionId,
})
);
});

View file

@ -113,7 +113,7 @@ export class StreamableHTTPServerTransport implements Transport {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
Connection: "keep-alive",
"Mcp-Session-Id": this._sessionId,
"mcp-session-id": this._sessionId,
});
const connection: StreamConnection = {
@ -214,7 +214,7 @@ export class StreamableHTTPServerTransport implements Transport {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
Connection: "keep-alive",
"Mcp-Session-Id": this._sessionId,
"mcp-session-id": this._sessionId,
});
const connectionId = randomUUID();
@ -249,7 +249,7 @@ export class StreamableHTTPServerTransport implements Transport {
// use direct JSON response
res.writeHead(200, {
"Content-Type": "application/json",
"Mcp-Session-Id": this._sessionId,
"mcp-session-id": this._sessionId,
});
// handle each message