Reads a fetch Headers object into a plain record.
Headers
Headers.entries() collapses same-name values into a single comma-joined string, so iterating once is enough. set-cookie is the exception: Headers preserves it as a distinct list exposed only via getSetCookie(), so it is merged explicitly.
Headers.entries()
set-cookie
getSetCookie()
Headers of a fetch Response.
Response
Plain header record, set-cookie kept as an array.
Reads a fetch
Headersobject into a plain record.Headers.entries()collapses same-name values into a single comma-joined string, so iterating once is enough.set-cookieis the exception:Headerspreserves it as a distinct list exposed only viagetSetCookie(), so it is merged explicitly.