I am using Azure CDN (Ex: https://example-cdn.azureedge.com
) to deliver static website from backend-endpoint which is Blob storage. Everything works fine except that Http request for static file(Ex: translation files stored on assets folder location /assets/i18n/en.json
) from Angular application (Ex: https://example.com
) are failed. As per the document, CORS is automatically set to *
.
What I observed is that Angular application while making http request using HttpClient
does a preflight
request before making actual GET request. Azure CDN seems to be not supporting preflight OPTIONS
request. Browser request fails with an error message Response for preflight does not have HTTP ok status
.
Here is the snapshot of Rules set on Azure CDN
Question is, how to request files conditionally from Azure CDN using Angular application
If anyone facing the this issue, please make sure your original host is responding to these requests. In my case, Azure Storage Account was the original host. CDN started to respond after enabling CORS settings on Storage account.