Merge pull request #231 from Exlau/exlau/sse-cache-control-header-fix

fix: 🐛 can't establish sse when server side enable compress
This commit is contained in:
Justin Spahr-Summers 2025-04-07 11:18:32 +01:00 • committed by GitHub
commit 0c437a81be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -24,7 +24,7 @@ describe("SSEClientTransport", () => {
// Send SSE headers
res.writeHead(200, {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
"Cache-Control": "no-cache, no-transform",
Connection: "keep-alive",
});
@ -185,7 +185,7 @@ describe("SSEClientTransport", () => {
if (req.method === "GET") {
res.writeHead(200, {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
"Cache-Control": "no-cache, no-transform",
Connection: "keep-alive",
});
res.write("event: endpoint\n");
@ -399,7 +399,7 @@ describe("SSEClientTransport", () => {
res.writeHead(200, {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
"Cache-Control": "no-cache, no-transform",
Connection: "keep-alive",
});
res.write("event: endpoint\n");
@ -526,7 +526,7 @@ describe("SSEClientTransport", () => {
if (auth === "Bearer new-token") {
res.writeHead(200, {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
"Cache-Control": "no-cache, no-transform",
Connection: "keep-alive",
});
res.write("event: endpoint\n");
@ -612,7 +612,7 @@ describe("SSEClientTransport", () => {
res.writeHead(200, {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
"Cache-Control": "no-cache, no-transform",
Connection: "keep-alive",
});
res.write("event: endpoint\n");

View file

@ -44,7 +44,7 @@ export class SSEServerTransport implements Transport {
this.res.writeHead(200, {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
"Cache-Control": "no-cache, no-transform",
Connection: "keep-alive",
});