问题
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