@nxtedition/nxt-undici 7.3.16 → 7.3.18

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.
@@ -45,17 +45,14 @@ export default () => (dispatch) => {
45
45
  resolve([err, null])
46
46
  } else {
47
47
  const now = getFastNow()
48
- const prev = cache.get(hostname)
49
- const prevByAddr = prev ? new Map(prev.map((r) => [r.address, r])) : null
50
48
  const val = records.map(({ address }) => {
51
- const old = prevByAddr?.get(address)
52
49
  return {
53
50
  address,
54
51
  expires: now + (ttl ?? 1e3),
55
52
  pending: 0,
56
- errored: old ? old.errored : 0,
53
+ errored: 0,
57
54
  counter: 0,
58
- timeout: old ? old.timeout : 0,
55
+ timeout: 0,
59
56
  }
60
57
  })
61
58
 
@@ -134,6 +131,7 @@ export default () => (dispatch) => {
134
131
  if (!record) {
135
132
  throw Object.assign(new Error(`No available DNS records found for ${hostname}`), {
136
133
  code: 'ENOTFOUND',
134
+ data: { records },
137
135
  })
138
136
  }
139
137
 
@@ -47,13 +47,17 @@ export default () => (dispatch) => {
47
47
  schedulers.set(opts.origin, scheduler)
48
48
  }
49
49
 
50
- scheduler.acquire(() => {
51
- const priorityHandler = new Handler(handler, scheduler)
52
- try {
53
- dispatch(opts, priorityHandler)
54
- } catch (err) {
55
- priorityHandler.onError(err)
56
- }
57
- }, opts.priority)
50
+ const priorityHandler = new Handler(handler, scheduler)
51
+ scheduler.acquire(
52
+ (priorityHandler) => {
53
+ try {
54
+ dispatch(opts, priorityHandler)
55
+ } catch (err) {
56
+ priorityHandler.onError(err)
57
+ }
58
+ },
59
+ opts.priority,
60
+ priorityHandler,
61
+ )
58
62
  }
59
63
  }
@@ -202,7 +202,7 @@ class Handler extends DecoratorHandler {
202
202
  this.#trailers = trailers
203
203
 
204
204
  if (this.#statusCode < 400) {
205
- if (this.#end != null && this.#pos !== this.#end) {
205
+ if (this.#end != null && this.#pos !== this.#end && this.#opts.method !== 'HEAD') {
206
206
  this.#maybeError(new Error('Response body length mismatch with Content-Range'))
207
207
  return
208
208
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/nxt-undici",
3
- "version": "7.3.16",
3
+ "version": "7.3.18",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "main": "lib/index.js",
@@ -9,8 +9,8 @@
9
9
  "lib/*"
10
10
  ],
11
11
  "dependencies": {
12
- "@nxtedition/scheduler": "^3.0.8",
13
- "@nxtedition/undici": "^11.1.3",
12
+ "@nxtedition/scheduler": "^4.1.1",
13
+ "@nxtedition/undici": "^11.1.4",
14
14
  "cache-control-parser": "^2.2.0",
15
15
  "fast-querystring": "^1.1.2",
16
16
  "http-errors": "^2.0.1",
@@ -18,17 +18,17 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@eslint/js": "^10.0.1",
21
- "@types/node": "^25.2.3",
22
- "eslint": "^10.0.0",
21
+ "@types/node": "^25.5.2",
22
+ "eslint": "^10.2.0",
23
23
  "eslint-plugin-n": "^17.24.0",
24
24
  "husky": "^9.1.7",
25
- "lint-staged": "^16.2.7",
26
- "pino": "^9.6.0",
25
+ "lint-staged": "^16.4.0",
26
+ "pino": "^10.3.1",
27
27
  "pinst": "^3.0.0",
28
28
  "prettier": "^3.8.1",
29
29
  "send": "^1.2.1",
30
- "tap": "^21.5.1",
31
- "undici-types": "^7.22.0"
30
+ "tap": "^21.6.3",
31
+ "undici-types": "^8.0.2"
32
32
  },
33
33
  "scripts": {
34
34
  "prepare": "husky",