Requests to Azure CDN calls with custom headers are failing even though CORS is setup

Kiran Paul 0 Reputation points Microsoft Employee
2024-04-17T23:50:22.96+00:00

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?

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
576 questions
{count} votes