由于'X-Frame-Options'到'SAMEORIGIN',Laravel 4拒绝加载iframe [英] Laravel 4 refuses to load iframe due to 'X-Frame-Options' to 'SAMEORIGIN'

查看:503
本文介绍了由于'X-Frame-Options'到'SAMEORIGIN',Laravel 4拒绝加载iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个Chrome扩展程序,我在Gmail主页的弹出窗口中显示iframe。由于Gmail主页采用HTTPS格式,因此我的iframe也应采用https格式。我通过启用mod_ssl配置了apache2,并在apache2上运行了HTTPS。我制作了一个原生的PHP页面,并尝试在Gmail页面上的框架上显示该页面。我没有遇到从localhost加载页面的问题。但是当我想使用Laravel后端时,它显示错误。



拒绝显示'https:// localhost / laravel / laravel /一个框架中的public / index.php / chromelogin',因为它将'X-Frame-Options'设置为'SAMEORIGIN'。



任何建议在 bootstrap / start.php 中添加以下行file:

  $ app-> forgetMiddleware('Illuminate\Http\FrameGuard'); 


I am building a chrome extension in which I am showing an iframe on a popup from the Gmail home page. As Gmail home page is in HTTPS , my iframe should also be in https. I configured apache2 by enabling mod_ssl and got HTTPS working on apache2. I made a native PHP page and tried to show that on the frame which is on Gmail page. I had no problems it was loading the page from localhost. But when I wanted to use a Laravel backend, it showed me error.

Refused to display 'https://localhost/laravel/laravel/public/index.php/chromelogin' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

Any Suggestions??

解决方案

Add following line in your bootstrap/start.php file:

$app->forgetMiddleware('Illuminate\Http\FrameGuard');

这篇关于由于'X-Frame-Options'到'SAMEORIGIN',Laravel 4拒绝加载iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆