I have set the X-Frame-Options header in Apache to DENY. The response header is correctly sent to the browser (see image). I just created a simple HTML file that loads an iframe which is loaded without any issue. I also checked Chrome devtools and the response header returns "x-frame-options: DENY". I was assuming that the header would block all iframes from being loaded?
2
Answers
Please do not send Access-Control-Allow-Origin to response if you are sending it. That could solve your problem
Not really.
X-Frame-Options: DENY
prevent YOUR page from being loaded inside aniframe
.X-Frame-Options: SAMEORIGIN
– will block only loading from other domains.It does nothing with iframes on the current page.
Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options