Overcoming “Display forbidden by X-Frame-Options”

后端 未结 26 2193
梦谈多话
梦谈多话 2020-11-21 06:31

I\'m writing a tiny webpage whose purpose is to frame a few other pages, simply to consolidate them into a single browser window for ease of viewing. A few of the pages I\'

26条回答
  •  情书的邮戳
    2020-11-21 07:07

    I was using Tomcat 8.0.30, none of the suggestions worked for me. As we are looking to update the X-Frame-Options and set it to ALLOW, here is how I configured to allow embed iframes:

    • Navigate to Tomcat conf directory, edit the web.xml file
    • Add the below filter:
    
                httpHeaderSecurity
                org.apache.catalina.filters.HttpHeaderSecurityFilter
                       
                               hstsEnabled
                               true
                       
                       
                               antiClickJackingEnabled
                               true
                       
                       
                               antiClickJackingOption
                               ALLOW-FROM
                       
                true
           
    
           
                       httpHeaderSecurity
                       /*
                       REQUEST
            
    
    • Restart Tomcat service
    • Access the resources using an iFrame.

提交回复
热议问题