Google Cloud CDN is set with a backend bucket which is configured and working for signed cookies when called via curl
.
I have the Cloud-CDN-Cookie set correctly in the browser, but when calling the CDN, the Request Headers don't include it (No Cookie header present).
When called in the browser, with a fetch like this:
fetch('https://<bucket-ip>/test/test.png', {
method: 'GET',
credentials: 'include',
})
The browser returns the following error:
Access to fetch at 'https:///test/test.png' from origin 'http://localhost:5173' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'.
Does Google CDN need to return this 'Access-Control-Allow-Credentials' header for it to work? I wasn't able to find anywhere how to add this header in the response from Google CDN.
I've found a way to make the cdn send the response headers I needed.
In this section: