【发布时间】:2015-03-17 02:37:34
【问题描述】:
我一直在尝试将“Access-Control-Allow-Origin”标头添加到使用自托管 Owin 应用程序提供的文件中
到目前为止,这是我的创业课程
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseCors(CorsOptions.AllowAll);
app.UseFileServer(new FileServerOptions()
{
RequestPath = PathString.Empty,
FileSystem = new PhysicalFileSystem(@"C:\test"),
EnableDirectoryBrowsing = false,
});
}
}
我找到了 UseCors 函数,但它似乎没有帮助。
我也环顾四周并尝试覆盖 UseFileServer 方法,并手动修改标头,但没有这样的运气。
非常感谢任何帮助。
【问题讨论】: