javascript - Why can I not see all the expected headers from a Fetch Response? -
i using fetch api make http request.
fetch(url, options) .then(response => console.log(...response.headers.keys())); // "content-type"
but can see chrome there more headers in inbound http response (date, server, transfer-encoding, x-foo). why might not able see them in output above code?
i running chrome following flags:
c:\path\chrome.exe --disable-web-security --user-data-dir=c:\path\tmp\chrome
response:
body: (...) bodyused: false headers: headers ok: true status: 200 statustext: "ok" type: "cors" url: "http://origin?query"
i note making non-cors request retains headers. cors strip them?
body: (...) bodyused: false headers: headers ok: true status: 200 statustext: "ok" type: "basic" url: "http://origin?query"
Comments
Post a Comment