Skip to content

Commit f66a55b

Browse files
authored
Revert "fix(server): application/json header for notifictions" (modelcontextprotocol#1388)
1 parent 40f6ba7 commit f66a55b

3 files changed

Lines changed: 2 additions & 8 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'@modelcontextprotocol/server': patch
33
---
44

5-
add application/json header for notifications
5+
reverting application/json in notifications

packages/middleware/node/test/streamableHttp.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,6 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
657657
const response = await sendPostRequest(baseUrl, batchNotifications, sessionId);
658658

659659
expect(response.status).toBe(202);
660-
expect(response.headers.get('content-type')).toBe('application/json');
661660
});
662661

663662
it('should handle batch request messages with SSE stream for responses', async () => {

packages/server/src/server/streamableHttp.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -667,12 +667,7 @@ export class WebStandardStreamableHTTPServerTransport implements Transport {
667667
for (const message of messages) {
668668
this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo });
669669
}
670-
return new Response(null, {
671-
status: 202,
672-
headers: {
673-
'Content-Type': 'application/json'
674-
}
675-
});
670+
return new Response(null, { status: 202 });
676671
}
677672

678673
// The default behavior is to use SSE streaming

0 commit comments

Comments
 (0)