将 http 标头添加到 SSRS

Sho*_*hoo 5 reporting-services ssrs-2012

有没有办法将自定义 http 响应标头添加到来自 SSRS 的响应中?

类似于将以下内容添加到 IIS web.config 文件?我尝试将它添加到 C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\web.config 但它不起作用。

<system.webServer>
        <httpProtocol>
            <customHeaders>
            <add name="X-Frame-Options" value="SAMEORIGIN" />
         </customHeaders>
     </httpProtocol>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)

这是在运行 SQL Server 2012 的 Windows 2012 r2 上。

仅供参考,我不是在谈论报告本身中的列标题。

谢谢,肖恩

Sho*_*hoo 0

所以我从未找到一种方法将其应用于所有页面,但我们使用表单身份验证并希望将其用于登录页面,因此在后面的代码中我添加了以下内容:

private void Page_Load(object sender, System.EventArgs e)
{
   Response.AddHeader("X-Frame-Options", "SAMEORIGIN");
}
Run Code Online (Sandbox Code Playgroud)