Unable to update AWS S3 CORS POLICY

前端 未结 3 2100
没有蜡笔的小新
没有蜡笔的小新 2021-02-19 10:18

I needed to change my AWS S3 bucket CORS policy to enable the upload of files for my ReactJS to AWS S3, but I keep getting this API response:

Expected params

3条回答
  •  你的背包
    2021-02-19 10:54

    I'm not sure if this helps. I ran into this same problem recently and it seems like AWS made some changes with how we define our CORS configurations. For example, if you want to allow certain Methods on your S3 bucket in the past you have to do something like this on the editor:

    
    
        *
        GET
        PUT
        POST
        HEAD
        DELETE
        3000
        *
    
    

    The config below is equivalent to the one on the top but takes the form of an array.

    [
        {
            "AllowedHeaders": [
                "*"
            ],
            "AllowedMethods": [
                "GET",
                "PUT",
                "POST",
                "HEAD",
                "DELETE"
            ],
            "AllowedOrigins": [
                "*"
            ],
            "ExposeHeaders": [],
            "MaxAgeSeconds": 3000
        }
    ]
    

    Let me know if this helps. Thank you!

提交回复
热议问题