After fetch only one Set-Cookie is recognized from response

if(method == 'POST'){
         let origin_formData = await request.text()
         data = {
             method: method,
             headers: new_request_headers,
             body : origin_formData
         }
}
let original_response = await fetch(url.href, data)
console.log(original_response.headers.get('Set-Cookie'));
console.log(new_response_headers.getAll('Set-Cookie'));

After a POST request, I can see multiple Set-Cookie headers in response headers from remote server to local wrangler dev environment according to Wireshark. But somehow wrangler only gets the first one and pass it to the client (web browser). The last two console logs show only the first Set-Cookie header. It is supposed to be showing three Set-Cookie headers, at least from the getAll().
This is not a duplicate issue of Don't fold Set-Cookie headers with Headers.append(). I am not appending multiple Set-Cookie headers on Worker, but I am trying to pass the response headers from upstream which already has three Set-Cookie headers.
It’s not folded. Only the first Set-Cookie is shown in the logs. The second and third Set-Cookie are just ignored.
I cannot change the upstream. What I want to do is to find a way to pass all the Set-Cookie headers and modify some other headers.
Is there any way to get around this?
Thanks!

Can somebody help me? I believe it’s a wrangler or Fetch API bug that count’t be fixed on my side.

how was the created? There is a difference between a formal Headers fetch API object and just a JavaScript generic object (JSON) with the same prop-val list. multiple set cookie headers collapsing to means at some point you had a JSON object not a Headers object in copying the origin response headers.

You have to do a getAll() on origin resp header obj, forEach on the Array, in each iteration call append() on headers object. you cannot serialize to object literal to copy headers objects. The copy / assignment will drop the not-duplicate set-cookies in object literal notation.