尝试从Amazon S3服务器加载图像(将crossorigin设置为匿名)后,我们仍然遇到可怕的错误:
XMLHttpRequest cannot load
http://resource-url No
'Access-Control-Allow-Origin' header is present on the requested resource. Origin
'http://server-url' is therefore not allowed access.
Run Code Online (Sandbox Code Playgroud)
我们已经尝试了几种CORS配置,例如
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Run Code Online (Sandbox Code Playgroud)
以及Amazon的默认CORS配置。仍然,同样的错误。
其他一些注意事项:
curl -XGET -H 'Origin: anonymous' http://resource-url 返回看起来像是图像,从 ?PNG我尽力了,因此,不胜感激。非常感谢!
我正在尝试构建一个AFrame应用程序,用户可以点击某些内容并显示新的场景.从那里,用户可以点击其他内容等.此场景的数据来自API,因此很难知道用户可能遇到的所有可能场景.
考虑到这一点,您将如何在运行时修改AFrame场景?显然修改DOM不起作用,但如果有办法让AFrame在某个时间重新渲染场景,那就太棒了.如果您认为还有另一种方法可以解决这个问题,我很乐意听到.谢谢!