API 网关自定义 headers 不会持续存在

API Gateway Custom headers won't persist

我想添加一个custom header to an API Gateway resource. I select the resource on API Gateway and select Enable CORS. Then add custom-header to the Access-Control-Allow-Headers comma separated list. No matter what I do I can't save the new custom header to Api gateway. I'm following the Amplify documentation

'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,my-custom-header'。 Api网关显示添加成功。但是当我返回启用 CORS 时,我看不到更新。我也重新部署了 api,但它仍然没有反映新的变化。

当 API 调用未被正确授权时也会抛出此错误。即使不是 CORS 错误,也可以显示 CORS 错误。

我在尝试对现有 API 网关使用放大时遇到了同样的问题。我使用以下文章来帮助解决此问题。 https://www.qloudx.com/using-angular-to-invoke-apis-hosted-on-amazon-api-gateway-secured-using-cognito-user-pools/?unapproved=53&moderation-hash=3e2d91efec236374c2e551b5810590f8#comment-53

If 可能不是您正在寻找的解决方案,但确实可以帮助您朝着正确的方向前进。