2017-08-02 16 views

回答

0

避免在元標籤中使用它。這樣做在IIS,或應用程序:

protected void Application_BeginRequest(object sender, EventArgs e) 
{ 
    HttpContext.Current.Response.AddHeader("x-frame-options", "DENY"); 
} 

<httpProtocol> 
    <customHeaders> 
    <add name="X-Frame-Options" value="DENY" /> 
    </customHeaders> 
</httpProtocol> 

如果你想允許特定的域,然後使用允許,從選項並沒有否認。

此標頭可能不適用於舊瀏覽器,例如Mozilla 3.0,因此您還需要實施客戶端驗證,名爲busting JS。請點擊此處查看:https://www.owasp.org/index.php/Clickjacking_Defense_Cheat_Sheet