有没有办法在Github页面上启用CORS? [英] Is there a way to enable CORS on Github pages?
本文介绍了有没有办法在Github页面上启用CORS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Github页面上托管一些JSON文件,但是我无法使用 $。getJSON
来检索它们,除非它们来自完全相同的域。 p>
有没有办法为Github页面启用CORS?
解决方案
Github现在已启用CORS。
CORS标题:
-Control-Allow-Origin:*
默认情况下添加来自Github页面的所有响应! p>
I'm hosting some JSON files on Github pages, but I am unable to use $.getJSON
to retrieve them unless they come from the exact same domain.
Is there a way to enable CORS for Github pages?
解决方案
Github Pages now has CORS enabled.
The CORS header:
Access-Control-Allow-Origin: *
Is added by default on all responses from Github pages!
这篇关于有没有办法在Github页面上启用CORS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文