- 新しい順
- 投票が多い順
- コメントが多い順
Hello,
The CORS error you're experiencing when adding headers is likely due to the configuration on AWS API Gateway not matching the requirements of your application's requests. Ensure that:
- CORS is enabled on your API Gateway.
- The Lambda function returns the necessary CORS headers if you're using Lambda Proxy Integration.
- The OPTIONS preflight response is correctly configured in API Gateway to include CORS headers.
After making any changes, redeploy your API for the updates to take effect. If the issue persists, verify the request headers and consult CloudWatch Logs for further debugging.
This error might be occurring because your API Gateway is not configured to handle CORS for requests with custom headers like Authorization. When you add custom headers to your request, the browser sends a preflight request (an HTTP OPTIONS request) to the server to check if the actual request is allowed. Your API Gateway needs to respond to this preflight request with the appropriate CORS headers.
Solution: Enabling CORS for a REST API resource
関連するコンテンツ
- AWS公式更新しました 1年前
- AWS公式更新しました 1年前
- AWS公式更新しました 2年前
The screenshots are too small / not readable to review if Access-Control-Allow-Headers includes "Authorization". Can you add those as text into the question?