hosting fonts on azure cdn - CORS support

2019-01-25 10:29发布

I cannot get azure blob storage hosted fonts exposed via azure cdn working in IE or Firefox.

I believe this is because of @font-face cross-domain issues (CORS) and the normal solution is to add an Access-Control-Allow-Origin header. I know that most CDNs now support this but am assuming that Azure still doesn't. Can anyone confirm this?

If this is the case, are there any workarounds?

4条回答
冷血范
2楼-- · 2019-01-25 11:09

The CDN doesn't modify the headers from the origin, so it responds with whatever headers blob storage emits. Blob storage does not support CORS headers.

I'm surprised to learn that @font-face has cross-domain restrictions, but it appears that you're right (for Firefox and IE).

If you have that option, you could put the fonts on a cloud service (rather than blob storage) behind the CDN and emit the right headers there.

查看更多
家丑人穷心不美
3楼-- · 2019-01-25 11:15

I can use fonts, without setting up the CORS option anyway. I'm linking my fonts directly to the blob storage, and not a CDN, since this one does not supports the CORS from the blob.

查看更多
We Are One
4楼-- · 2019-01-25 11:18

Your assessment is correct.

As a workaround, our company is utilizing Google storage (which supports CORS).

I would also suggest voting up this issue so the Azure team knows how many people are running into it.

http://www.mygreatwindowsazureidea.com/forums/34192-windows-azure-feature-voting/suggestions/2850796-support-cross-origin-resource-sharing-cors-via-a

查看更多
登录 后发表回答