fulmine.js 5.18.0 → 5.18.1
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/package.json +1 -1
- package/src/request.js +5 -3
package/package.json
CHANGED
package/src/request.js
CHANGED
|
@@ -914,9 +914,11 @@ module.exports = class Request extends LazyReadable {
|
|
|
914
914
|
if (this.#responseEnded) {
|
|
915
915
|
return;
|
|
916
916
|
}
|
|
917
|
-
//
|
|
918
|
-
//
|
|
919
|
-
|
|
917
|
+
// The bytes are copied because uWS neuters `ab` when this callback returns, and a
|
|
918
|
+
// view of it would corrupt whatever is still queued. Buffer.from over a view rather
|
|
919
|
+
// than ab.slice(0): the slice allocates an ArrayBuffer of its own for every chunk,
|
|
920
|
+
// which on a small body costs several times the copying it is there to do.
|
|
921
|
+
const chunk = Buffer.from(new Uint8Array(ab));
|
|
920
922
|
const accepted = this.push(chunk);
|
|
921
923
|
// push() may synchronously end the response via a flowing-mode listener.
|
|
922
924
|
if (!accepted && !isLast && !this.#responseEnded) {
|