File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,10 @@ function compression (options) {
254
254
res . removeHeader ( 'Content-Length' )
255
255
256
256
// compression
257
+ stream . on ( 'error' , function ( err ) {
258
+ res . emit ( 'error' , err )
259
+ } )
260
+
257
261
stream . on ( 'data' , function onStreamData ( chunk ) {
258
262
if ( _write . call ( res , chunk ) === false ) {
259
263
stream . pause ( )
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ describe('compression()', function () {
147
147
it ( 'res.write() should call callback with error after end' , function ( done ) {
148
148
var onErrorCalled = false
149
149
var onError = function ( err ) {
150
- assert . ok ( err . code === 'ERR_STREAM_WRITE_AFTER_END' )
150
+ assert . ok ( err . message === 'write after end' || err . code === 'ERR_STREAM_WRITE_AFTER_END' )
151
151
onErrorCalled = true
152
152
}
153
153
@@ -598,7 +598,7 @@ describe('compression()', function () {
598
598
it ( 'should return false writing after end' , function ( done ) {
599
599
var onErrorCalled = false
600
600
var onError = function ( err ) {
601
- assert . ok ( err . code === 'ERR_STREAM_WRITE_AFTER_END' )
601
+ assert . ok ( err . message === 'write after end' || err . code === 'ERR_STREAM_WRITE_AFTER_END' )
602
602
onErrorCalled = true
603
603
}
604
604
You can’t perform that action at this time.
0 commit comments