ultimate-express 2.0.12 → 2.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/response.js +3 -1
package/package.json
CHANGED
package/src/response.js
CHANGED
|
@@ -197,8 +197,9 @@ module.exports = class Response extends Writable {
|
|
|
197
197
|
} else if (!ok) {
|
|
198
198
|
this._res.ab = chunk;
|
|
199
199
|
this._res.abOffset = lastOffset;
|
|
200
|
+
let handlerUsed = false;
|
|
200
201
|
this._res.onWritable((offset) => {
|
|
201
|
-
if (this.finished) return true;
|
|
202
|
+
if (this.finished || handlerUsed) return true;
|
|
202
203
|
const [ok, done] = this._res.tryEnd(this._res.ab.slice(offset - this._res.abOffset), this.totalSize);
|
|
203
204
|
if (done) {
|
|
204
205
|
this.finished = true;
|
|
@@ -206,6 +207,7 @@ module.exports = class Response extends Writable {
|
|
|
206
207
|
}
|
|
207
208
|
if (ok) {
|
|
208
209
|
this.writingChunk = false;
|
|
210
|
+
handlerUsed = true;
|
|
209
211
|
callback(null);
|
|
210
212
|
}
|
|
211
213
|
return ok;
|