什么mime类型应该作为WOFF字体?
我服务truetype(ttf)字体as font/truetype和opentype(otf)as font/opentype,但我找不到WOFF字体的正确格式.
我曾尝试font/woff,font/webopen和font/webopentype,但Chrome仍然会抱怨:
"资源被解释为字体,但使用MIME类型application/octet-stream进行传输."
有人知道吗?
我正在使用VNext + OSX + Chrome进行一些实验.我正在尝试获取woff2文件
GET http://localhost:5003/fonts/fontawesome-webfont.woff2?v=4.3.0
Run Code Online (Sandbox Code Playgroud)
但是会发生错误.请参阅下面的请求标题
Remote Address:127.0.0.1:5003
Request URL:http://localhost:5003/fonts/fontawesome-webfont.woff2?v=4.3.0
Request Method:GET
Status Code:404 Not Found
Run Code Online (Sandbox Code Playgroud)
这是我的Startup.cs
public void Configure(IApplicationBuilder app)
{
app.UseStaticFiles();
app.UseServices(services =>
{
services.AddMvc();
});
// Add MVC to the request pipeline
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action}/{id?}",
defaults: new { controller = "Home", action = "Index" });
});
}
Run Code Online (Sandbox Code Playgroud)
我在Github的AspNet项目里面看到了StaticFiles(Link bellow),它似乎得到了支持.
你们能给我一些帮助吗?