@nxtedition/lib 25.1.3 → 25.1.4

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/http.js +0 -11
  2. package/package.json +1 -1
package/http.js CHANGED
@@ -140,8 +140,6 @@ export class Context {
140
140
 
141
141
  function noop() {}
142
142
 
143
- const pendingSet = (globalThis._nxt_lib_http_pending ??= new Set())
144
-
145
143
  export async function upgradeMiddleware(ctx, next) {
146
144
  const { req, socket } = ctx
147
145
  const startTime = performance.now()
@@ -158,7 +156,6 @@ export async function upgradeMiddleware(ctx, next) {
158
156
 
159
157
  const isHealthcheck = req.url === '/healthcheck' || req.url === '/_up'
160
158
 
161
- pendingSet.add(ctx)
162
159
  try {
163
160
  if (req.method === 'GET' || req.method === 'HEAD' || req.method === 'OPTIONS') {
164
161
  req.resume() // Dump the body if there is one.
@@ -206,8 +203,6 @@ export async function upgradeMiddleware(ctx, next) {
206
203
  }
207
204
  socket.destroy(err)
208
205
  } finally {
209
- pendingSet.delete(ctx)
210
-
211
206
  if (!socket.writableEnded && !socket.destroyed) {
212
207
  socket.destroy()
213
208
  ctx.logger?.warn('socket destroyed')
@@ -219,7 +214,6 @@ export async function requestMiddleware(ctx, next) {
219
214
  const { req, res } = ctx
220
215
  const startTime = performance.now()
221
216
 
222
- pendingSet.add(ctx)
223
217
  try {
224
218
  if (req.method === 'GET' || req.method === 'HEAD' || req.method === 'OPTIONS') {
225
219
  req.resume() // Dump the body if there is one.
@@ -328,8 +322,6 @@ export async function requestMiddleware(ctx, next) {
328
322
  res.destroy(err)
329
323
  }
330
324
  } finally {
331
- pendingSet.delete(ctx)
332
-
333
325
  if (res.writableEnded || res.destroyed || res.stream?.destroyed) {
334
326
  // Do nothing..
335
327
  } else {
@@ -636,7 +628,6 @@ export async function request(ctx, next) {
636
628
 
637
629
  let reqLogger = logger
638
630
 
639
- pendingSet.add(ctx)
640
631
  try {
641
632
  ctx.url = requestTarget(req)
642
633
  if (!ctx.url) {
@@ -746,8 +737,6 @@ export async function request(ctx, next) {
746
737
  }
747
738
  }
748
739
  } finally {
749
- pendingSet.delete(ctx)
750
-
751
740
  if (!res.writableEnded) {
752
741
  res.destroy()
753
742
  logger.debug('request destroyed')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "25.1.3",
3
+ "version": "25.1.4",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",