@eik/core 2.1.73 → 2.1.74
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/CHANGELOG.md +7 -0
- package/lib/multipart/parser.js +7 -1
- package/lib/utils/utils.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [2.1.74](https://github.com/eik-lib/core/compare/v2.1.73...v2.1.74) (2026-08-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* prevent process crash on second busboy error and fix UTF-8 chunk corruption ([#633](https://github.com/eik-lib/core/issues/633)) ([9f5e3ec](https://github.com/eik-lib/core/commit/9f5e3ecab5ea8ceed16a0826c0c9c1824e68beac)), closes [#9](https://github.com/eik-lib/core/issues/9) [#11](https://github.com/eik-lib/core/issues/11)
|
|
7
|
+
|
|
1
8
|
## [2.1.73](https://github.com/eik-lib/core/compare/v2.1.72...v2.1.73) (2026-08-14)
|
|
2
9
|
|
|
3
10
|
|
package/lib/multipart/parser.js
CHANGED
|
@@ -106,7 +106,13 @@ const MultipartParser = class MultipartParser {
|
|
|
106
106
|
},
|
|
107
107
|
);
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
// Use .on() instead of .once() so that a second error emitted
|
|
110
|
+
// by a concurrent _handleFile failure (after the first error has
|
|
111
|
+
// already removed a .once() listener) does not hit zero listeners
|
|
112
|
+
// and crash the process with an unhandled EventEmitter throw.
|
|
113
|
+
// Calling reject() a second time is a safe no-op on an already-
|
|
114
|
+
// settled Promise.
|
|
115
|
+
busboy.on("error", (/** @type {any} */ error) => {
|
|
110
116
|
reject(error);
|
|
111
117
|
});
|
|
112
118
|
|
package/lib/utils/utils.js
CHANGED
|
@@ -22,7 +22,7 @@ const readJSON = (sink, path) =>
|
|
|
22
22
|
|
|
23
23
|
pipeline(from.stream, to, (error) => {
|
|
24
24
|
if (error) return reject(error);
|
|
25
|
-
const str =
|
|
25
|
+
const str = Buffer.concat(buffer).toString("utf8");
|
|
26
26
|
try {
|
|
27
27
|
const obj = JSON.parse(str);
|
|
28
28
|
return resolve(obj);
|
|
@@ -86,7 +86,7 @@ const streamCollector = (from) =>
|
|
|
86
86
|
|
|
87
87
|
pipeline(from, to, (error) => {
|
|
88
88
|
if (error) return reject(error);
|
|
89
|
-
return resolve(
|
|
89
|
+
return resolve(Buffer.concat(buffer).toString("utf8"));
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
92
|
|