Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,15 @@ function compression (options) {
var _on = res.on
var _write = res.write

var flushCB = function flushCB () {
stream.flush()
}

// flush
res.flush = function flush () {
if (stream) {
stream.flush()
// call write and pass flushCB to force synchronous behavior
stream.write('', flushCB)
}
}

Expand Down