【发布时间】:2020-07-21 07:02:16
【问题描述】:
我在 .Net Core 3.0 中有一个 IdentityServer4 项目,我尝试删除 X-Frame-Options 标头但失败了。我试过了:
public void ConfigureServices(IServiceCollection services)
{
...
services.AddAntiforgery(options => options.SuppressXFrameOptionsHeader = true);
...
}
和
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
...
app.Use(async (context, next) =>
{
context.Response.Headers.Remove("X-Frame-Options");
await next();
});
...
}
以上是因为我需要从 iframe 加载网页。 我真的很感谢你的帮助。 谢谢。
【问题讨论】:
标签: iframe .net-core identityserver4 x-frame-options