Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Refused to display document because display forbidden by X-Frame-Options." Edit header

I am developing an application for a social network. When I try to access it I get an error in my browser:

Refused to display document because display forbidden by X-Frame-Options.

This social network uses Iframe. My question is, how do I change the header to solve this problem?

Considering Overcoming "Display forbidden by X-Frame-Options", in my servlet I tried command:

httpServletResponse.addHeader("X-FRAME-OPTIONS", "SAMEORIGIN" ); 

Considering http://www.rivercitystudio.com/blog/2011/09/google-maps-embedding-x-frame-options-change/ I've also tried adding in my url the following:

&output=embed

None of the two alternatives worked.

like image 882
vctlzac Avatar asked Nov 20 '11 18:11

vctlzac


1 Answers

If it's your page that is in the frame, then don't send X-Frame-Options at all. The default is to allow embedding.

If it's social network's page that is in the frame, then there's no way to disable it. The whole point of this is prevention of clickjacking via frames.

like image 111
Kornel Avatar answered Jan 04 '23 08:01

Kornel