Fail to enable CORS for API Gateway functions

后端 未结 4 862
误落风尘
误落风尘 2021-02-05 04:09

I get

While attempting to enable CORS on API Gateway, why is that and how do I resolve this? These functions are deployed using AWS SAM. But I notice if I crea

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-05 04:36

    Firstly please select your root resource and select "Enable CORS". It will enable CORS to all methods. Ideally it should work. If in case it doesn't work Please add an empty json in the response as I have marked in the screenshot attached. I believe you don't have any default response header added in your OPTIONS method response (in Method Response ). Please refer screenshot

提交回复
热议问题