dongxiee0744 2016-04-29 07:25
浏览 660
已采纳

视频iframe嵌入引发403最新的ios更新

We run a website that displays embedded videos. The videos are embedded via an iframe. The iframe src only allows the referrer to be the website the video is being displayed on otherwise it throws a 403. The website is responsive. Since the latest IOS(9.3 and 9.3.1) updates if you refresh one on these pages the 403 gets thrown. This happens in safari and chrome. The embed iframe is controlled by checking an array of allowed referrers using PHP

In our tests users with an earlier version of IOS do not have the same problem.

Can anyone shed any light on why this might be happening?

Thanks

Matthew

  • 写回答

1条回答 默认 最新

  • dqrnsg6439 2016-04-29 07:50
    关注

    This seems to be a bug in WebKit:

    https://bugs.webkit.org/show_bug.cgi?id=155754

    To workaround this, I'd suggest generating a random token in the 'outer' page, and appending it to the URL of the iframe (and saving it in a session or some other database). Then you could check whether an 'correct' token is sent.

    While this requires you to have both pages (the video and the 'outer page') on the same server, this solution is more secure than referrer checking, as the user could send any string in the "referrer header".

    Alternatively, simply skip the check for iOS 9.3 && 9.3.1, and hope that everybody upgrades to iOS 9.3.2 in the near future, which appears to have the bug fixed.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?