Skip to content

Commit 562625a

Browse files
committed
Add flushCompression as an alias for flush
Supports use such as: ```javascript // Not going to write again for a while. If compression middleware is // installed let's tell it to flush what we've got through to the client. if (res.flushCompression) { res.flushCompression(); } ``` Currently the `res` object has a `flush` method regardless of whether compression middleware is installed. The built-in `flush` method issues a noisy deprecation warning. This patch provides an alias for the `flush` method to allow detection of the compression middleware's `flush`. This addresses expressjs#72.
1 parent 3333505 commit 562625a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function compression(options) {
6565
var stream
6666

6767
// flush
68-
res.flush = function flush() {
68+
res.flush = res.flushCompression = function flush() {
6969
if (stream) {
7070
stream.flush()
7171
}

0 commit comments

Comments
 (0)