Skip to content

Commit 6c15dcb

Browse files
committed
fix: 🐛 can't establish sse when server side enable compress
1 parent 7840129 commit 6c15dcb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/client/sse.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("SSEClientTransport", () => {
2424
// Send SSE headers
2525
res.writeHead(200, {
2626
"Content-Type": "text/event-stream",
27-
"Cache-Control": "no-cache",
27+
"Cache-Control": "no-cache, no-transform",
2828
Connection: "keep-alive",
2929
});
3030

@@ -183,7 +183,7 @@ describe("SSEClientTransport", () => {
183183
if (req.method === "GET") {
184184
res.writeHead(200, {
185185
"Content-Type": "text/event-stream",
186-
"Cache-Control": "no-cache",
186+
"Cache-Control": "no-cache, no-transform",
187187
Connection: "keep-alive",
188188
});
189189
res.write("event: endpoint\n");
@@ -397,7 +397,7 @@ describe("SSEClientTransport", () => {
397397

398398
res.writeHead(200, {
399399
"Content-Type": "text/event-stream",
400-
"Cache-Control": "no-cache",
400+
"Cache-Control": "no-cache, no-transform",
401401
Connection: "keep-alive",
402402
});
403403
res.write("event: endpoint\n");
@@ -524,7 +524,7 @@ describe("SSEClientTransport", () => {
524524
if (auth === "Bearer new-token") {
525525
res.writeHead(200, {
526526
"Content-Type": "text/event-stream",
527-
"Cache-Control": "no-cache",
527+
"Cache-Control": "no-cache, no-transform",
528528
Connection: "keep-alive",
529529
});
530530
res.write("event: endpoint\n");
@@ -610,7 +610,7 @@ describe("SSEClientTransport", () => {
610610

611611
res.writeHead(200, {
612612
"Content-Type": "text/event-stream",
613-
"Cache-Control": "no-cache",
613+
"Cache-Control": "no-cache, no-transform",
614614
Connection: "keep-alive",
615615
});
616616
res.write("event: endpoint\n");

src/server/sse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class SSEServerTransport implements Transport {
4444

4545
this.res.writeHead(200, {
4646
"Content-Type": "text/event-stream",
47-
"Cache-Control": "no-cache",
47+
"Cache-Control": "no-cache, no-transform",
4848
Connection: "keep-alive",
4949
});
5050

0 commit comments

Comments
 (0)