args[0] = this.statusCode
args.length = 1
}
}
return prevWriteHead.apply(this, args)
}
}
/**
* Execute a listener when a response is about to write headers.
node:_http_server:338:8
ServerResponse._implicitHeader
node_modules/compression/index.js:103:14
ServerResponse.end
// estimate the length
if (!this.getHeader('Content-Length')) {
length = chunkLength(chunk, encoding)
}
this._implicitHeader()
}
if (!stream) {
return _end.call(this, chunk, encoding)
}