@nxtedition/lib 20.4.0 → 20.4.1
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/http.js +54 -34
- package/package.json +1 -1
- package/serializers.js +0 -1
package/http.js
CHANGED
|
@@ -181,42 +181,52 @@ export class ServerResponse extends http.ServerResponse {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
flushHeaders() {
|
|
184
|
-
if (this
|
|
185
|
-
this.#timing.headers
|
|
186
|
-
|
|
184
|
+
if (!this.destroyed) {
|
|
185
|
+
if (this.#timing.headers === -1) {
|
|
186
|
+
this.#timing.headers = performance.now() - this.#now
|
|
187
|
+
this.#now += this.#timing.headers
|
|
188
|
+
}
|
|
187
189
|
}
|
|
188
190
|
return super.flushHeaders()
|
|
189
191
|
}
|
|
190
192
|
|
|
191
193
|
write(chunk, encoding, callback) {
|
|
192
|
-
if (this
|
|
193
|
-
this.#timing.data
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
if (!this.destroyed) {
|
|
195
|
+
if (this.#timing.data === -1) {
|
|
196
|
+
this.#timing.data = performance.now() - this.#now
|
|
197
|
+
this.#now += this.#timing.data
|
|
198
|
+
}
|
|
196
199
|
|
|
197
|
-
|
|
198
|
-
|
|
200
|
+
if (this.#timing.headers === -1) {
|
|
201
|
+
this.#timing.headers = this.#timing.data
|
|
202
|
+
}
|
|
199
203
|
}
|
|
200
204
|
|
|
201
205
|
return super.write(chunk, encoding, callback)
|
|
202
206
|
}
|
|
203
207
|
|
|
204
208
|
end(chunk, encoding, callback) {
|
|
205
|
-
if (this
|
|
206
|
-
this.#timing.data
|
|
207
|
-
|
|
208
|
-
|
|
209
|
+
if (!this.destroyed) {
|
|
210
|
+
if (this.#timing.data === -1) {
|
|
211
|
+
this.#timing.data = performance.now() - this.#now
|
|
212
|
+
this.#now += this.#timing.data
|
|
213
|
+
}
|
|
209
214
|
|
|
210
|
-
|
|
211
|
-
|
|
215
|
+
if (this.#timing.headers === -1) {
|
|
216
|
+
this.#timing.headers = this.#timing.data
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
this.#timing.complete = performance.now() - this.#created
|
|
212
220
|
}
|
|
213
221
|
|
|
214
222
|
return super.end(chunk, encoding, callback)
|
|
215
223
|
}
|
|
216
224
|
|
|
217
225
|
destroy(err) {
|
|
218
|
-
if (this
|
|
219
|
-
this.#timing.complete
|
|
226
|
+
if (!this.destroyed) {
|
|
227
|
+
if (this.#timing.complete === -1) {
|
|
228
|
+
this.#timing.complete = performance.now() - this.#created
|
|
229
|
+
}
|
|
220
230
|
}
|
|
221
231
|
|
|
222
232
|
return super.destroy(err)
|
|
@@ -246,42 +256,52 @@ export class Http2ServerResponse extends http2.Http2ServerResponse {
|
|
|
246
256
|
}
|
|
247
257
|
|
|
248
258
|
flushHeaders() {
|
|
249
|
-
if (this
|
|
250
|
-
this.#timing.headers
|
|
251
|
-
|
|
259
|
+
if (!this.destroyed) {
|
|
260
|
+
if (this.#timing.headers === -1) {
|
|
261
|
+
this.#timing.headers = performance.now() - this.#now
|
|
262
|
+
this.#now += this.#timing.headers
|
|
263
|
+
}
|
|
252
264
|
}
|
|
253
265
|
return super.flushHeaders()
|
|
254
266
|
}
|
|
255
267
|
|
|
256
268
|
write(chunk, encoding, callback) {
|
|
257
|
-
if (this
|
|
258
|
-
this.#timing.data
|
|
259
|
-
|
|
260
|
-
|
|
269
|
+
if (!this.destroyed) {
|
|
270
|
+
if (this.#timing.data === -1) {
|
|
271
|
+
this.#timing.data = performance.now() - this.#now
|
|
272
|
+
this.#now += this.#timing.data
|
|
273
|
+
}
|
|
261
274
|
|
|
262
|
-
|
|
263
|
-
|
|
275
|
+
if (this.#timing.headers === -1) {
|
|
276
|
+
this.#timing.headers = this.#timing.data
|
|
277
|
+
}
|
|
264
278
|
}
|
|
265
279
|
|
|
266
280
|
return super.write(chunk, encoding, callback)
|
|
267
281
|
}
|
|
268
282
|
|
|
269
283
|
end(chunk, encoding, callback) {
|
|
270
|
-
if (this
|
|
271
|
-
this.#timing.data
|
|
272
|
-
|
|
273
|
-
|
|
284
|
+
if (!this.destroyed) {
|
|
285
|
+
if (this.#timing.data === -1) {
|
|
286
|
+
this.#timing.data = performance.now() - this.#now
|
|
287
|
+
this.#now += this.#timing.data
|
|
288
|
+
}
|
|
274
289
|
|
|
275
|
-
|
|
276
|
-
|
|
290
|
+
if (this.#timing.headers === -1) {
|
|
291
|
+
this.#timing.headers = this.#timing.data
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
this.#timing.complete = performance.now() - this.#created
|
|
277
295
|
}
|
|
278
296
|
|
|
279
297
|
return super.end(chunk, encoding, callback)
|
|
280
298
|
}
|
|
281
299
|
|
|
282
300
|
destroy(err) {
|
|
283
|
-
if (this
|
|
284
|
-
this.#timing.complete
|
|
301
|
+
if (!this.destroyed) {
|
|
302
|
+
if (this.#timing.complete === -1) {
|
|
303
|
+
this.#timing.complete = performance.now() - this.#created
|
|
304
|
+
}
|
|
285
305
|
}
|
|
286
306
|
|
|
287
307
|
return super.destroy(err)
|
package/package.json
CHANGED