fix(fastify-sse): add X-Accel-Buffering header to per-request startSSE
Aligns with hub.ts which already includes this header. Prevents nginx/Traefik from buffering SSE chunks behind a reverse proxy.
This commit is contained in:
parent
e194365711
commit
e6ccaec2fe
@ -27,6 +27,7 @@ describe('per-request SSE helpers', () => {
|
|||||||
'Content-Type': 'text/event-stream',
|
'Content-Type': 'text/event-stream',
|
||||||
'Cache-Control': 'no-cache',
|
'Cache-Control': 'no-cache',
|
||||||
Connection: 'keep-alive',
|
Connection: 'keep-alive',
|
||||||
|
'X-Accel-Buffering': 'no',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ export function startSSE(reply: FastifyReply): void {
|
|||||||
'Content-Type': 'text/event-stream',
|
'Content-Type': 'text/event-stream',
|
||||||
'Cache-Control': 'no-cache',
|
'Cache-Control': 'no-cache',
|
||||||
Connection: 'keep-alive',
|
Connection: 'keep-alive',
|
||||||
|
'X-Accel-Buffering': 'no',
|
||||||
});
|
});
|
||||||
reply.hijack();
|
reply.hijack();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user