如何配置Amazon S3 CORS以便Firefox将加载远程托管的webfonts?

Ant*_*ony 8 firefox amazon-s3 webfonts cors

我一直在尝试将Amazon S3设置为webfont文件主机,以便在Tumblr上使用webfonts.

亚马逊建议的CORS配置适用于除Firefox之外的所有内容,这与亚马逊在S3中启用此新CORS功能之前的情况完全相同.

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
    <AllowedOrigin>http://fonttester.tumblr.com/</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <MaxAgeSeconds>3000</MaxAgeSeconds>
    <AllowedHeader>Authorization</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Run Code Online (Sandbox Code Playgroud)

我应该使用不同的配置吗?

ram*_*mpr 3

您必须添加以下内容

<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <MaxAgeSeconds>3000</MaxAgeSeconds>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>
Run Code Online (Sandbox Code Playgroud)

  • 为什么我被否决了?你尝试过吗?AllowedOrigin * 允许来自所有域的请求。特别是对于字体,响应 OPTIONS 请求时,GET 的AllowedMethod 和AllowedHeader * 确保加载字体,并且MaxAgeSeconds 指定缓存响应的时间。我使用它并且它可以在我的网站上使用 - http://apps.facebook.com/sudokuquest/ (2认同)