[英]Access-Control-Allow-Origin HTTP header in Jekyll site in Github
After upgrading to latest Google Chrome I'm getting the following error. 升级到最新的谷歌浏览器后,我收到以下错误。
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.
来自“ http://fonts.gstatic.com ”的字体已被跨源资源共享策略阻止加载:请求的资源上没有“Access-Control-Allow-Origin”标头。
Because of this the web fonts are not working. 因此,Web字体无法正常工作。 I know that if I add Access-Control-Allow-Origin HTTP header it will work.
我知道,如果我添加Access-Control-Allow-Origin HTTP标头,它将起作用。 But my site is a Jekyll site and it is hosted in using Github.
但我的网站是一个Jekyll网站,它使用Github托管。
So how to add Access-Control-Allow-Origin
http header in Jekyll generated site hosted in Github? 那么如何在Github中托管的Jekyll生成的站点中添加
Access-Control-Allow-Origin
http头?
This is an answer to an old question, but hopefully it will help someone. 这是一个老问题的答案,但希望它会帮助某人。
If you are accessing Google Maps API or Fonts using http, try using the https version instead. 如果您使用http访问Google Maps API或字体,请尝试使用https版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.