nodejs / undici

An HTTP/1.1 client, written from scratch for Node.js
https://nodejs.github.io/undici
MIT License
6.08k stars 529 forks source link

fetch: don't use pooled buffer in body mixin #3377

Closed tsctx closed 3 months ago

tsctx commented 3 months ago

completely fix #3337

tsctx commented 3 months ago

@mcollina there are many such cases, should they be fixed?

KhafraDev commented 3 months ago

I think there's still some questions left to answer here. Mostly: is this something we need? If not (and I am assuming we don't), what benefit is there in adding it?

tsctx commented 3 months ago

is this something we need? If not (and I am assuming we don't), what benefit is there in adding it?

I also have my doubts. but, double cloning can be avoided, as in the commit just added.

In fact, it is not skipping the spec, but creating a new arraybuffer at safeBufferConcat according to this, which should not be a violation of the spec.

tsctx commented 3 months ago

Hmm... If I was to say it, It is completely fix #3337, but we may not need to worry about pooled buffer.