I'm trying to intercept Set-Cookie
response header from fetch
's response:
fetch('https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png', {
method: 'get'
}).then(function(response) {
for (var pair of response.headers.entries()) {
console.log(`${pair[0]}: ${pair[1]}`);
}
});
But not all of the headers (as can be seen in developer tools' network) can be found in there! Why is that? Is there any way I can get the header I'm looking for?
Just for clarification, I'm not looking for the cookie but I'm interested to know when the Set-Cookie
header is sent.