【发布时间】:2014-11-29 10:01:32
【问题描述】:
我在 tumblr 上为我的网站托管博客:
blog.withoomph.com
我已经修改了博客的主题,我想使用我自己在我们的主站点上使用的字体。我正在尝试从以下位置获取字体:
beta.withomph.com
但是,当页面尝试获取字体时,我收到了 CORS 错误。这只是最近才开始发生,因为它们过去被毫无问题地提取。
有没有一种方法可以设置 IIS 或我的 MVC 应用程序以将这些字体提供给子域?
编辑
对不起,我应该知道的比这更好。以下是更多信息:
这是获取网址的 CSS:
@font-face {
font-family: 'avantgarde';
src: url('http://beta.withoomph.com/content/fonts/avant_garde.eot');
src: url('http://beta.withoomph.com/content/fonts/avant_garde.eot?#iefix') format('embedded-opentype'),
url('http://beta.withoomph.com/content/fonts/avant_garde.woff') format('woff'),
url('http://beta.withoomph.com/content/fonts/avant_garde.ttf') format('truetype'),
url('http://beta.withoomph.com/content/fonts/avant_garde.svg#avantgarde_bk_btdemi') format('svg');
font-weight: normal;
font-style: normal;
}
这是开发控制台尝试获取字体时的错误:
来自“http://beta.withoomph.com”的字体已被阻止 通过跨域资源共享策略加载:否 请求中存在“Access-Control-Allow-Origin”标头 资源。因此不允许使用原点“http://blog.withoomph.com” 访问。
【问题讨论】:
-
我们可以看看一些代码吗?
-
是的,对不起,这是一个糟糕的问题,希望额外的信息能让事情更清楚。
标签: c# asp.net-mvc cors