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

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

问题描述

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

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.

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

任何建议?

推荐答案

在您的 bootstrap/start.php 文件中添加以下行:

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

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

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

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