外部(CDN 托管)图像请求 URL 在 IE8 中通过 https 重写在画布页面上,请求 proxy.php
我在 Facebook 上有一个基于画布的应用程序,需要加载大量图像,因此我使用 JavaScript 创建它们。
var img = new Image();
img.src = document.location.protocol + '//example.cloudfront.net/example_path/example.png';
这些图像托管在 Amazon 的 CDN 上,其基本 URL 类似于:
https://example.cloudfront.net/example_path/example.png
托管在云(EC2,也是 Amazon)中的应用程序的 URL 类似于:
https://cloud.example.com/path_to_app/
它适用于大多数浏览器,但不适用于 IE (8)。
在 IE 中,如果我检查创建的图像的 src 属性,它会显示正确的 URL,但浏览器发出以下请求:
GET /path_to_app/proxy.php?url=https://example.cloudfront.net/example_path/example.png HTTPS/1.1
我的服务器上没有 proxy.php服务器,“代理”一词也没有出现在我的代码中,无论是客户端还是服务器端。
对于通过 https 提供的 iframe 画布页面中的外部托管内容,是否有一些我不知道的内容?
I have a canvas-based app on Facebook wit a lot of images to load, so I'm creating them in JavaScript.
var img = new Image();
img.src = document.location.protocol + '//example.cloudfront.net/example_path/example.png';
The images are hosted on Amazon's CDN, their base URL is similar to:
https://example.cloudfront.net/example_path/example.png
The URL of the app, hosted in a cloud (EC2, also Amazon) is similar to:
https://cloud.example.com/path_to_app/
It works on most browsers, but not in IE (8).
In IE, if I inspect the src property of a created image, it shows the correct URL, but the browser makes the following request:
GET /path_to_app/proxy.php?url=https://example.cloudfront.net/example_path/example.png HTTPS/1.1
There is no proxy.php on my server, nor is the word 'proxy' present anywhere in my code, neither client- nor server-side.
Is there something I don't know about externally hosted content in an iframe canvas page, served over https?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了问题。
我在 IE 中使用 flashcanvas 来模拟
问题是,flashcanvas 源代码被最小化/混淆,因此字符串“proxy”不可见。
I found the problem.
I'm using flashcanvas in IE to emulate the <canvas> element. There are cross-domain asset access security issues with Flash, so the applet requests them via a proxy php script (actually included in the distribution, lol).
Trouble was, the flashcanvas source code is minimized/obfuscated, so the string 'proxy' is not visible.