0

i'm adding facebook comments plugin from this web plugin comment facebook , but i get error Refused to display 'https://www.facebook.com/' in a frame because it set 'X-Frame-Options' to 'deny' . I've tried various ways but the result is zonk, please help me.. I'm using laravel 8 i tried using this method target="_top" but can't, i also tried this but its not working

public function handle(Request $request, Closure $next)
  {
    $response = $next($request);
    $response->headers->set('X-Frame-Options', 'SAMEORIGIN', false);
    return $response;

  }
Eliavina
  • 5
  • 3
  • Are you using apache ? – Ken Lee Aug 11 '22 at 04:32
  • from what I see this plugin is a front-end only plugin (so PHP or Laravel should not apply). Can you share the exact steps you took to embed it? – apokryfos Aug 11 '22 at 04:33
  • @KenLee yes i use apache – Eliavina Aug 11 '22 at 04:34
  • @apokryfos i copied and pasted the code snippet from https://developers.facebook.com/docs/plugins/comments?locale=id_ID to my blade, when i clear cache it works perfectly, but when i login facebook then i get this error – Eliavina Aug 11 '22 at 04:37
  • @KenLee I've looked for the x-frame-options setting in httpd.conf but couldn't find it – Eliavina Aug 11 '22 at 04:41
  • Of course you won't find it on your end - and your attempt to _set_ it, is also pointless. This is a response header sent _by_ the site that was attempted to display inside the iframe - so that's Facebook, not you. – CBroe Aug 11 '22 at 06:13
  • @CBroe then what should i do? I'm really dizzy with this – Eliavina Aug 11 '22 at 06:26
  • I am currently getting the same result, so it might be that Facebook broke something once again. I'd recommend keeping an eye on their bug tracker / status report page. – CBroe Aug 11 '22 at 06:49

0 Answers0