Closed
Description
Describe the bug
Lines 625 to 643 in e36062c
While serving assets and encoding is 'br' there is a race condition, seeing code we are piping 2 times. Should be only 1 time
readStream.pipe(createBrotliCompress()).pipe(res);
pipeline(readStream, createBrotliCompress(), res, onError);
below is the error I'm getting below error when serving /socket.io.min.js
error Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
at new NodeError (node:internal/errors:393:5)
at ServerResponse.<anonymous> (node:internal/streams/pipeline:352:14)
at ServerResponse.emit (node:events:525:35)
at ServerResponse.emit (node:domain:489:12)
at emitCloseNT (node:_http_server:961:10)
at processTicksAndRejections (node:internal/process/task_queues:81:21) {
code: 'ERR_STREAM_PREMATURE_CLOSE'
}
To Reproduce
When browser uses br
as accept encoding to download files added in <script src="">
Getting the above error.
Expected behavior
A clear and concise description of what you expected to happen.
Platform:
- Device: [e.g. Samsung S8]
- OS: [e.g. Android 9.2]