I am unable to access the ‘set-cookie’ headers from the response object of calling fetch
. Here is a sample code that demonstrates this issue
import fetch from 'node-fetch';
const response = await fetch(`${BASE_URL}/loginWithEmail`, {
method: 'POST',
body: JSON.stringify(payload),
headers: {
'Content-Type': 'application/json',
},
});
const rawCookies = response.headers.raw()['set-cookie']; // undefined
I’ve tested the code locally using node-fetch
package and it works perfectly fine over there. Is it due to the environment forge is running on or am I missing something here?