undici 7.27.0 → 7.27.2

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/lib/global.js CHANGED
@@ -32,7 +32,7 @@ function setGlobalDispatcher (agent) {
32
32
  }
33
33
 
34
34
  function getGlobalDispatcher () {
35
- return globalThis[globalDispatcher]
35
+ return globalThis[legacyGlobalDispatcher]
36
36
  }
37
37
 
38
38
  // These are the globals that can be installed by undici.install().
@@ -13,6 +13,9 @@ class UnwrapController {
13
13
 
14
14
  [kResume] = null
15
15
 
16
+ rawHeaders = null
17
+ rawTrailers = null
18
+
16
19
  constructor (abort) {
17
20
  this.#abort = abort
18
21
  }
@@ -72,11 +75,13 @@ module.exports = class UnwrapHandler {
72
75
  }
73
76
 
74
77
  onUpgrade (statusCode, rawHeaders, socket) {
78
+ this.#controller.rawHeaders = rawHeaders
75
79
  this.#handler.onRequestUpgrade?.(this.#controller, statusCode, parseHeaders(rawHeaders), socket)
76
80
  }
77
81
 
78
82
  onHeaders (statusCode, rawHeaders, resume, statusMessage) {
79
83
  this.#controller[kResume] = resume
84
+ this.#controller.rawHeaders = rawHeaders
80
85
  this.#handler.onResponseStart?.(this.#controller, statusCode, parseHeaders(rawHeaders), statusMessage)
81
86
  return !this.#controller.paused
82
87
  }
@@ -87,6 +92,7 @@ module.exports = class UnwrapHandler {
87
92
  }
88
93
 
89
94
  onComplete (rawTrailers) {
95
+ this.#controller.rawTrailers = rawTrailers
90
96
  this.#handler.onResponseEnd?.(this.#controller, parseHeaders(rawTrailers))
91
97
  }
92
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici",
3
- "version": "7.27.0",
3
+ "version": "7.27.2",
4
4
  "description": "An HTTP/1.1 client, written from scratch for Node.js",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
@@ -212,6 +212,8 @@ declare namespace Dispatcher {
212
212
  get aborted(): boolean
213
213
  get paused(): boolean
214
214
  get reason(): Error | null
215
+ rawHeaders?: Buffer[] | string[] | IncomingHttpHeaders | null
216
+ rawTrailers?: Buffer[] | string[] | IncomingHttpHeaders | null
215
217
  abort(reason: Error): void
216
218
  pause(): void
217
219
  resume(): void