Requests to Azure CDN calls with custom headers are failing even though CORS is setup
Kiran Paul
0
Reputation points Microsoft Employee
I'm trying to make a call using fetch to a resource in CDN.
When doing this, it works fine:
fetch('https://claritystatic.azureedge.net/resources/canvaskit0.38.3/canvaskit.wasm')
But if I do something like this it fails with the preflight check returning 403:
fetch('https://claritystatic.azureedge.net/resources/canvaskit0.38.3/canvaskit.wasm', {headers: { 'x-clarity-test': 1 }})
The azure CDN is setup with rules engine that return headers:
Access-Control-Allow-Headers: *
Access-Control-Allow-Methods: *
Access-Control-Allow-Origin: *
I have tried purging the cache within CDN as well to no avail. What is going wrong here?