Skip to content

Commit

Permalink
fix(stream): remove Transfer-Encoding header
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainLanz committed Sep 28, 2023
1 parent b976a7e commit 046e238
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@ export class Stream extends Transform {
pipe<T extends HeaderStream>(destination: T, options?: { end?: boolean }): T {
if (destination.writeHead) {
destination.writeHead(200, {
'Content-Type': 'text/event-stream; charset=utf-8',
'Transfer-Encoding': 'identity',
'Cache-Control': 'no-cache',
'Cache-Control': 'private, no-cache, no-store, must-revalidate, max-age=0, no-transform',
'Connection': 'keep-alive',
// @see https://github.com/dunglas/mercure/blob/master/hub/subscribe.go#L124-L130
'Content-Type': 'text/event-stream',
'Expire': '0',
'Pragma': 'no-cache',
// @see https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/#x-accel-buffering
'X-Accel-Buffering': 'no',
})

destination.flushHeaders?.()
Expand Down

0 comments on commit 046e238

Please sign in to comment.