@nxtedition/nxt-undici 1.0.10 → 1.0.12
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/index.js +17 -11
- package/lib/interceptor/signal.js +4 -0
- package/package.json +6 -6
package/lib/index.js
CHANGED
|
@@ -102,18 +102,23 @@ class Readable extends stream.Readable {
|
|
|
102
102
|
return Buffer.concat(buffers)
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
dump() {
|
|
106
|
+
return new Promise((resolve) => {
|
|
107
|
+
if (this.closed) {
|
|
108
|
+
resolve(null)
|
|
109
|
+
} else {
|
|
110
|
+
let n = 0
|
|
111
|
+
this.on('close', () => resolve(null))
|
|
112
|
+
.on('error', () => {})
|
|
113
|
+
.on('data', (chunk) => {
|
|
114
|
+
n += chunk.length
|
|
115
|
+
if (n > 128 * 1024) {
|
|
116
|
+
this.destroy()
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
.resume()
|
|
113
120
|
}
|
|
114
|
-
}
|
|
115
|
-
// Do nothing...
|
|
116
|
-
}
|
|
121
|
+
})
|
|
117
122
|
}
|
|
118
123
|
}
|
|
119
124
|
|
|
@@ -251,6 +256,7 @@ async function request(url, opts) {
|
|
|
251
256
|
}
|
|
252
257
|
},
|
|
253
258
|
onBodySent(chunk) {},
|
|
259
|
+
onRequestSent() {},
|
|
254
260
|
onHeaders(statusCode, rawHeaders, resume, statusMessage) {
|
|
255
261
|
const headers = parseHeaders(rawHeaders)
|
|
256
262
|
|
|
@@ -25,6 +25,10 @@ class Handler {
|
|
|
25
25
|
return this.handler.onBodySent(chunk)
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
onRequestSent() {
|
|
29
|
+
return this.handler.onRequestSent()
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
onHeaders(statusCode, rawHeaders, resume, statusMessage) {
|
|
29
33
|
return this.handler.onHeaders(statusCode, rawHeaders, resume, statusMessage)
|
|
30
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/nxt-undici",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Nagy <robert.nagy@boffins.se>",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -11,18 +11,18 @@
|
|
|
11
11
|
"cache-control-parser": "^2.0.4",
|
|
12
12
|
"http-errors": "^2.0.0",
|
|
13
13
|
"lru-cache": "^10.0.1",
|
|
14
|
-
"undici": "^5.
|
|
14
|
+
"undici": "^5.27.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@types/node": "^20.8.
|
|
18
|
-
"eslint": "^8.
|
|
17
|
+
"@types/node": "^20.8.9",
|
|
18
|
+
"eslint": "^8.52.0",
|
|
19
19
|
"eslint-config-prettier": "^9.0.0",
|
|
20
20
|
"eslint-config-standard": "^17.0.0",
|
|
21
|
-
"eslint-plugin-import": "^2.
|
|
21
|
+
"eslint-plugin-import": "^2.29.0",
|
|
22
22
|
"eslint-plugin-n": "^16.2.0",
|
|
23
23
|
"eslint-plugin-promise": "^6.1.1",
|
|
24
24
|
"husky": "^8.0.3",
|
|
25
|
-
"lint-staged": "^
|
|
25
|
+
"lint-staged": "^15.0.2",
|
|
26
26
|
"pinst": "^3.0.0",
|
|
27
27
|
"prettier": "^3.0.3",
|
|
28
28
|
"tap": "^18.4.2"
|