API Gateway CORS Issue

后端 未结 2 903
野的像风
野的像风 2020-12-30 16:54

So I have CORS enabled going through the basic setup given by AWS Gateway. However for this API I need to allow Control Origins for all requests and allow credentials.

2条回答
  •  误落风尘
    2020-12-30 17:34

    Jurgen from API Gateway here. Thanks for reporting this issue. There is currently no simple way to set it up via the "Enable CORS" feature in the console. However, we are looking into it to improve the user experience for this use case.

    As a potential workaround, you could passthrough the Origin header from the client to your backend and parse / create the value for the Access-Control-Allow-Origin header there. Then you would map the Header in the Integration Response from 'integration.response.header.Access-Control-Allow-Origin' to Access-Control-Allow-Origin and return it to the client.

    Hope this helps.

    Best, Jurgen

提交回复
热议问题