Closed wKovacs64 closed 8 years ago
Hrm. Thanks for the PR, but I don't think this does what we expect it to. The flush is only actually meant to be called when using the compression
-middleware for express (or similar), as that triggers the gzip stream to be flushed. This PR will actually remove this functionality in favor of preventing some deprecation warnings.
Not 100% sure how to solve this. The best solution would be something that only triggered flush()
if the response is a compressed one, otherwise don't call flush/flushHeaders at all.
Yeah I was uncertain of this as well. Although it sounded like they just added flushHeaders
and deprecated flush
rather than renaming flush
so I assume they do the same thing. Perhaps not?
It's the same on plain Node responses, however the compression
middleware monkey-patches a new flush
method on top of the response which calls flush on the underlying gzip stream. It's confusing.
I see what you mean. Closing this for now, further research required.
Node was complaining about the use of the now-deprecated
flush()
function:Replacing
flush()
withflushHeaders()
removes the warning.