简体   繁体   English

Facebook X-Frame-Options和IIS 6

[英]Facebook X-Frame-Options & IIS 6

I need to open an URL, from an anchor situated on a page created for Facebook at the top-most level. 我需要从最顶层为Facebook创建的页面上的锚点中打开URL。 Doing some research, I found that the new X-Frame-Options restrictions are blocking this action and that a possible fix for this is to allow access at the requester level, ie. 经过研究,我发现新的X-Frame-Options限制阻止了此操作,对此的可能解决方法是允许请求者级别的访问。 my application. 我的应用程序。

The application is being hosted through IIS 6 so I could easily add the required custom header X-Frame-Options ALLOW-FROM http://www.mywebsite.com/ , however, I still get the refusal message when trying to click on a link in my page. 该应用程序是通过IIS 6托管的,因此我可以轻松添加所需的自定义标头X-Frame-Options ALLOW-FROM http://www.mywebsite.com/ ,但是,当我尝试单击一个链接到我的页面。

I cannot upgrade to a newer version of IIS as marketing material already went out. 由于行销资料已经过期,我无法升级到较新版本的IIS。 Is there another way to fix this, or am I adding the X-Frame-Options at the wrong location? 还有另一种方法可以解决此问题,还是我在错误的位置添加了X-Frame-Options?

Also, I have target="_top" in both my anchors. 另外,两个锚中都有target =“ _ top”。

I need to open an URL, from an anchor situated on a page created for Facebook at the top-most level. 我需要从最顶层为Facebook创建的页面上的锚点中打开URL。 Doing some research, I found that the new X-Frame-Options restrictions are blocking this action 经过研究,我发现新的X-Frame-Options限制阻止了此操作

No, it's the other way around - what the X-Frame-Options header does, is restrict a document from being displayed in any kind of frame environment. 不,这是另一种方式-X-Frame-Options标头的作用是限制文档任何类型的框架环境都无法显示。

and that a possible fix for this is to allow access at the requester level, ie. 对此的可能解决方法是允许请求者级别的访问,即。 my application. 我的应用程序。

No. The responder , that is, the web server delivering the resource, has to set that header to control where the document can be displayed or not. 否。 响应者 (即,提供资源的Web服务器)必须设置该标头来控制可以在何处显示文档。

From my experience, please consider the following scenario: Domain A: Your domain Domain B: Facebook 根据我的经验,请考虑以下情形:域A:您的域域B:Facebook

Your HTTP Response Header rule in IIS (assuming you're using IIS) would be: Name: X-Frame-Options Value: ALLOW-FROM http://www.facebook.com 您在IIS中的HTTP响应标头规则(假设您正在使用IIS)将是:名称:X-Frame-Options值:ALLOW-FROM http://www.facebook.com

This will allow facebook to host an iFrame with your content inside of it. 这样一来,facebook就能托管一个内含您内容的iFrame。 The parent of the iFrame is facebook.com which is why you must use this approach. iFrame的父目录是facebook.com,这就是为什么必须使用此方法的原因。 You would set the value to SAMEORIGIN if the host header you were supplying in the ALLOW-FROM value was the same as the hosting domain. 如果您在ALLOW-FROM值中提供的主机头与托管域相同,则可以将值设置为SAMEORIGIN。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Facebook分享者X-Frame-Options - Facebook sharer X-Frame-Options 加载 iframe Facebook(加载被 X-Frame-Options 拒绝) - Loading Iframe Facebook (Load denied by X-Frame-Options) X-Frame-Options禁止的Facebook App错误 - Facebook App Error forbidden by X-Frame-Options Facebook页面选项卡游戏,x-frame-options - Facebook page tab game, x-frame-options 修复Rails oauth facebook x-frame-options sameorigin错误 - Fix Rails oauth facebook x-frame-options sameorigin error X-Frame-Options:在Twitter上发布Facebook应用程序 - X-Frame-Options: Post on Twitter from Facebook application Facebook“喜欢按钮”返回 X-Frame-Options Deny - Facebook 'like button' return X-Frame-Options Deny 拒绝在一个框架中显示facebook.com/xti.php,因为它将X-Frame-options设置为sameorigin - Refused to display facebook.com/xti.php in a frame because it set X-Frame-options to sameorigin 拒绝在框架中显示,因为它将“X-Frame-Options”设置为 DENY facebook fb.ui 共享方法 - Refused to display in a frame because it set 'X-Frame-Options' to DENY facebook fb.ui share method Facebook登录错误:拒绝在框架中显示,因为它将'X-Frame-Options'设置为'DENY' - Facebook login error: Refused to display in a frame because it set 'X-Frame-Options' to 'DENY'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM