fetch doesn't read all headers from Response

I'm trying to use web-extensions on Safari 14 Preview
Safari Technology Preview: Release 109 (Safari 14.0, WebKit 15610.1.17.2)
macOS Catalina: 10.15.6 Beta (19G60d)

I'm trying to read a custom header from HTTP Response from background script, I see this header in the Response Headers list using a Network Tool, but the Response of fetch doesn't contain some headers

Example:
Code Block
fetch('https://postman-echo.com/response-headers?foo1=bar1&foo2=bar2').then(response => {
for (var header of response.headers) {
console.log(header);
}
});

What the code returns in Chrome:
Code Block
["content-length", "29"]
["content-type", "application/json; charset=utf-8"]
["date", "Wed, 01 Jul 2020 21:29:47 GMT"]
["etag", "W/"1d-PgOLWVqd2mMvcpNzTF0Cfy4hftg""]
["foo1", "bar1"]
["foo2", "bar2"]
["status", "200"]
["vary", "Accept-Encoding"]

Total: 8 fields

What the code returns in Safari 14.0:
Code Block
["content-length", "29"]
["content-type", "application/json; charset=utf-8"]
["date", "Wed, 01 Jul 2020 21:31:23 GMT"]
["etag", "W/\"1d-PgOLWVqd2mMvcpNzTF0Cfy4hftg\""]
["vary", "Accept-Encoding"]

Total: 5 fields. foo1 and foo2 are missing, also status is missing too

Response Headers
Code Block
:status: 200
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
Set-Cookie: sails.sid=s%3AVlXEk_Qo8GegZlyxPTVLlNInedtBVa6o.V3TX3KUohXJDyDD%2FL236OlZQILg%2BmKhAb09%2B0jZvDCM; Path=/; HttpOnly
Date: Wed, 01 Jul 2020 21:51:02 GMT
Content-Length: 29
ETag: W/"1c-x3TYsdbI+1JXz1RgJMU9sClKyGc"
foo1: bar1
foo2: bar2


Thanks for trying out Safari Web Extensions! Please send us a bug report via Feedback Assistant.

Thank you!
Sent via Feedback Assistant.
Hi @timothy.hatcher,
I posted a feedback 2 weeks ago to Feedback Assistant and I don't see any updates there

Feedback id: FB7843409 (fetch doesn't read all headers from Response)

How long need to wait for an answer?

Thank you!
I am not able to reproduce this in Safari Technology Preview 110. I am seeing foo1 and foo2 in response.headers. I’m curious why they don’t appear for you.

However, Chrome also seems to include status, which is not a real header — Chrome seems to be out-of-spec here. Firefox does not include status either.

If you need status, you should use response.status, which is part of the spec and supported by all browsers.
Hi @timothy.hatcher,

status is not important as other custom fields
Please note, that I call fetch from a Web Extension Background Page
I'm curious too - what I'm doing wrong

Thank you!
We have found a way to reproduce the issue and we are looking into it. Thanks for the bug report!
fetch doesn't read all headers from Response
 
 
Q