By using AWS re:Post, you agree to the Terms of Use

API Gateway HTTP + Lambda integration not enabling CORS


I have an API Gateway with an HTTP API + route that utilizes a Lambda function integration.

From the AWS documentation, I see

If you configure CORS for an API, API Gateway automatically sends a response to preflight OPTIONS requests, even if there isn't an OPTIONS route configured for your API. For a CORS request, API Gateway adds the configured CORS headers to the response from an integration. If you configure CORS for an API, API Gateway ignores CORS headers returned from your backend integration.

However, I still get the errors:

Access to fetch at '' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

From Cloudwatch, I can see the requests being sent to the API, but for some reason the header isn't properly configured. I do not understand this because I thought API Gateway should handle OPTIONS pre-flight requests for HTTP APIs. I cannot find out what I'm doing wrong. I'm not sure if it's because I'm not properly calling my API (link is, stage is dev, route is /upload) or something else.

1 Answer

Hello! In the example given, your URL would be This article from AWS Support contains some very detailed debugging steps to try: . Hope it helps!

answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions