简体   繁体   English

到 Amazon S3 的 XMLHttpRequest 仅在某些计算机上失败

[英]XMLHttpRequest to Amazon S3 fails only on some computers

Our web app is an uploader the pushes directly to Amazon S3.我们的网络应用程序是一个直接推送到 Amazon S3 的上传器。 It has never failed testing, however, now that a client has the software they are experiencing a 50/50 success rate per computer.然而,它从来没有失败过测试,现在客户拥有他们正在体验每台计算机 50/50 成功率的软件。

Seems that the error appears on any browser on the bad computers: XMLHttpRequest cannot load "www.DOMAIN.json".似乎错误出现在坏计算机上的任何浏览器上:XMLHttpRequest 无法加载“www.DOMAIN.json”。 Origin ... is not allowed by Access-Control-Allow-Origin. Access-Control-Allow-Origin 不允许 Origin ...。

  • host file does not have unique settings主机文件没有唯一的设置
  • network that the computer is connected to does affect outcome计算机连接的网络确实会影响结果
  • two similar computers (os, browser, network) and one works, the other doesn't.两台类似的计算机(操作系统、浏览器、网络),一台可以工作,另一台不行。

This is the jQuery uploader, modified.这是 jQuery 上传器,已修改。 We use CORS method.我们使用 CORS 方法。 https://duckduckgo.com/Cross-origin_resource_sharing?ia=about https://duckduckgo.com/Cross-origin_resource_sharing?ia=about

Any experienced cross-domain warriors out there?有没有经验丰富的跨域战士?

Good news!好消息! We sorted this out by adding https:// to the app URL.我们通过将 https:// 添加到应用程序 URL 来解决这个问题。 This doesn't 100% solve our current problem, but it allows us to program a more graceful fallback.这并不能 100% 解决我们当前的问题,但它允许我们编写更优雅的回退。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM