Skip to content

Commit

Permalink
Add flushCompression as an alias for flush
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gigabo committed Feb 17, 2016
1 parent 3333505 commit 562625a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function compression(options) {
var stream

// flush
res.flush = function flush() {
res.flush = res.flushCompression = function flush() {
if (stream) {
stream.flush()
}
Expand Down

0 comments on commit 562625a

Please sign in to comment.