In S3 Bucket CORS Configrations not allowing xml and asking for json instead

谁说我不能喝 提交于 2020-12-30 03:20:07

问题


In S3 Bucket CORS Configrations not allowing "XML" and asking for "Json" instead

<?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>

Was Working earlier but now it is giving me this error "The CORS configuration must be written in valid JSON." Some Changes are made in "Amazon S3 Bucket" by AMAZON , Please give me json of this to add in CORS ?


回答1:


In the new S3 console, the CORS configuration must be JSON. Read more here.

In your case, the JSON CORS configuration can be written as follow:

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "POST",
            "GET",
            "PUT"
        ],
        "AllowedOrigins": [
            "*"
        ]
    }
]


来源:https://stackoverflow.com/questions/64842173/in-s3-bucket-cors-configrations-not-allowing-xml-and-asking-for-json-instead

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!