if(method == 'POST'){
let origin_formData = await request.text()
data = {
method: method,
headers: new_request_headers,
body : origin_formData
}
}
let original_response = await fetch(url.href, data)
console.log(original_response.headers.get('Set-Cookie'));
console.log(new_response_headers.getAll('Set-Cookie'));
After a POST
request, I can see multiple Set-Cookie
headers in response headers from remote server to local wrangler dev environment according to Wireshark. But somehow wrangler only gets the first one and pass it to the client (web browser). The last two console logs show only the first Set-Cookie header. It is supposed to be showing three Set-Cookie
headers, at least from the getAll().
This is not a duplicate issue of Don't fold Set-Cookie headers with Headers.append(). I am not appending multiple Set-Cookie
headers on Worker, but I am trying to pass the response headers from upstream which already has three Set-Cookie
headers.
It’s not folded. Only the first Set-Cookie
is shown in the logs. The second and third Set-Cookie are just ignored.
I cannot change the upstream. What I want to do is to find a way to pass all the Set-Cookie headers and modify some other headers.
Is there any way to get around this?
Thanks!