升级到最新的 Google Chrome 后,我收到以下错误。
Font from origin 'http://fonts.gstatic.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
因此,网络字体无法正常工作。我知道如果我添加 Access-Control-Allow-Origin HTTP header 它将起作用。但我的网站是 Jekyll 网站,并且使用 Github 托管。
那么如何在 Github 托管的 Jekyll 生成的网站中添加 Access-Control-Allow-Origin
http header ?
最佳答案
gstatic.com 中的字体由 Access-Control-Allow-Origin:*
header 提供。
如前所述here ,这可能是代理问题。
有一件事是肯定的,您无法在 Github 页面上自行设置此 header 。
关于google-chrome - Github Jekyll 站点中的 Access-Control-Allow-Origin HTTP header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25574528/