ultimate-express 2.0.11 → 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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/response.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-express",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "The Ultimate Express. Fastest http server with full Express compatibility, based on uWebSockets.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -62,7 +62,7 @@
62
62
  "statuses": "^2.0.2",
63
63
  "tseep": "^1.3.1",
64
64
  "type-is": "^2.0.1",
65
- "uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.53.0",
65
+ "uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.55.0",
66
66
  "vary": "^1.1.2"
67
67
  },
68
68
  "devDependencies": {
@@ -85,7 +85,7 @@
85
85
  "express-handlebars": "^8.0.3",
86
86
  "express-http-proxy": "^2.1.2",
87
87
  "express-mongo-sanitize": "^2.2.0",
88
- "express-rate-limit": "^8.0.1",
88
+ "express-rate-limit": "^8.1.0",
89
89
  "express-session": "^1.18.2",
90
90
  "express-subdomain": "^1.0.6",
91
91
  "graphql-http": "^1.22.4",
@@ -99,7 +99,7 @@
99
99
  "pako": "^2.1.0",
100
100
  "passport": "^0.7.0",
101
101
  "passport-local": "^1.0.0",
102
- "pkg-pr-new": "^0.0.54",
102
+ "pkg-pr-new": "^0.0.60",
103
103
  "pug": "^3.0.3",
104
104
  "response-time": "^2.3.4",
105
105
  "serve-index": "^1.9.1",
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;