Linked Questions
27 questions linked to/from API Gateway CORS: no 'Access-Control-Allow-Origin' header
0 votes
1 answer
4k views
No 'Access-Control-Allow-Origin' header is present on the requested resource from an AWS API Gateway [duplicate]
I have made an API using AWS API Gateway that fires a Lambda function at a PostgreSQL RDS. When I call the API from my Angular application, I get the following error. Access to XMLHttpRequest at 'URL' ...
0 votes
0 answers
21 views
Debugging Amplify for CORS [duplicate]
I have an application with Front end : vue.js and AWS Amplify APIs with AWS API Gateway and Lambda DB : DynamoDB I am able to access my get method through my browser, but through my vue application ...
3365 votes
9 answers
6.6m views
Why does my JavaScript code receive a "No 'Access-Control-Allow-Origin' header is present on the requested resource" error, while Postman does not?
Mod note: This question is about why XMLHttpRequest/fetch/etc. on the browser are subject to the Same Access Policy restrictions (you get errors mentioning CORB or CORS) while Postman is not. This ...
1655 votes
21 answers
2.8m views
How does the 'Access-Control-Allow-Origin' header work?
Apparently, I have completely misunderstood its semantics. I thought of something like this: A client downloads JavaScript code MyCode.js from http://siteA - the origin. The response header of MyCode....
519 votes
12 answers
856k views
CORS: Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is true
I have a setup involving Frontend server (Node.js, domain: localhost:3000) <---> Backend (Django, Ajax, domain: localhost:8000) Browser <-- webapp <-- Node.js (Serve the app) Browser (...
22 votes
10 answers
26k views
AWS API Gateway endpoint gives CORS error when POST from static site on S3
I have created an API endpoint with Serverless(serverless.com) which I expose through API Gateway. I'm getting following error though I have enabled CORS from the XMLHttpRequest cannot load https:...
3 votes
7 answers
27k views
XMLHttpRequest error while using http post flutter web
I am facing this error XMLHttpRequest error. while making an HTTP post call to my API-AWS API Gateway. My current Flow is Flutter web -> API gateway -> lambda -> rds. I know there are already ...
2 votes
2 answers
3k views
Api Gateway cannot allow Access-Control-Allow-Origin
This url is in AWS API Gateway with method get and stage is well deployed. And I enabled CORS following the aws document. Here are my steps to enable CORS. -Resource->action->enable CORS-> default ...
6 votes
2 answers
3k views
Cors - how to handle preflight options request that requires a custom header? (AWS: private API gateway using a vpc endpoint)
I have seen posts about this but no questions or answers that match my problem closely enough to provide a valid answer. I can not send requests to the API through my browser. The problem, as far ...
3 votes
1 answer
2k views
What are the Angular Http Request status codes 0 and -1?
While checking out logs for a production app I noticed many failed HTTP requests with responses containing the status codes of 0 and -1. What is the difference between the status codes 1 and 0? I ...
2 votes
1 answer
3k views
AWS - How to enable CORS for Lambda Function
I'm trying to enable CORS for a Lambda function written in Go and below are my configuration and code. Here's my SAM config... AuthBindApi: Type: AWS::Serverless::Api Properties: ...
1 vote
1 answer
3k views
AWS Lambda - No 'Access-Control-Allow-Origin' header is present on the requested resource
I have AWS lambda function that I am trying to call from my web app using Axios. It keeps giving the error: 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' ...
1 vote
2 answers
1k views
AWS CORS problem CLOUDFRONT <> APIGATEWAY
I am struggling with the CORS error. I've deployed a backend using APIGATEWAY. It works properly via POSTMAN at the https://APIGATEWAY_URL I've deployed a web app using CLOUDFRONT, and it works too, ...
2 votes
1 answer
868 views
AWS API Gateway Responses via serverless framework
I'd like to be able to configure API Gateway Responses via serverless framework... This is what my serverless.yml looks like: #Deploy an api gateway with custom responses. --- service: test-apigw ...
2 votes
1 answer
2k views
AWS Lambda function API end point - 403 and 415 error
I have an AWS Lambda function that I've set up and am attempting to hit from the front end. It works fine in browser, and returns the response I expect. When I try to hit it from localhost, I get a ...