Skip to content

Commit 6b503c9

Browse files
committed
fix: add Transfer-Encoding chunked to SSE responses (#1619)
1 parent ccb78f2 commit 6b503c9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

packages/server/src/server/streamableHttp.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ export class WebStandardStreamableHTTPServerTransport implements Transport {
450450
const headers: Record<string, string> = {
451451
'Content-Type': 'text/event-stream',
452452
'Cache-Control': 'no-cache, no-transform',
453+
'Transfer-Encoding': 'chunked',
453454
Connection: 'keep-alive'
454455
};
455456

@@ -503,6 +504,7 @@ export class WebStandardStreamableHTTPServerTransport implements Transport {
503504
const headers: Record<string, string> = {
504505
'Content-Type': 'text/event-stream',
505506
'Cache-Control': 'no-cache, no-transform',
507+
'Transfer-Encoding': 'chunked',
506508
Connection: 'keep-alive'
507509
};
508510

@@ -751,6 +753,7 @@ export class WebStandardStreamableHTTPServerTransport implements Transport {
751753
const headers: Record<string, string> = {
752754
'Content-Type': 'text/event-stream',
753755
'Cache-Control': 'no-cache',
756+
'Transfer-Encoding': 'chunked',
754757
Connection: 'keep-alive'
755758
};
756759

0 commit comments

Comments
 (0)