Javascript 未能加载<;资源>;:否';访问控制允许原点';请求的资源上存在标头
当我尝试从S3存储桶中加载.svg图标时,控制台中出现了以下错误:Javascript 未能加载<;资源>;:否';访问控制允许原点';请求的资源上存在标头,javascript,jquery,amazon-s3,trumbowyg,Javascript,Jquery,Amazon S3,Trumbowyg,当我尝试从S3存储桶中加载.svg图标时,控制台中出现了以下错误: Failed to load https://<my_bucket>.s3.amazonaws.com/static/js/Trumbowyg-master/dist/ui/icons.svg: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://<my_site>.
Failed to load https://<my_bucket>.s3.amazonaws.com/static/js/Trumbowyg-master/dist/ui/icons.svg:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'https://<my_site>.com' is therefore not allowed access.
加载失败https://.s3.amazonaws.com/static/js/Trumbowyg-master/dist/ui/icons.svg:
请求的资源上不存在“Access Control Allow Origin”标头。
起源'https://.com因此,不允许访问。
你知道我该怎么解决这个问题吗
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
*
得到
邮递
放
*
您在s3控制台中配置了cors吗?没有。我只是快速搜索了一下,我的s3 UX没有显示启用cors的选项:|在本教程中:在步骤3中,它给出了选项。你知道为什么吗?看起来你对这个特殊svg的访问权限是有限的。去你的桶许可-看看我的答案。