Ravindra BagaleCourses & study guides मराठी Track your progress

Ravi Sir's Cards › AWS

Why browsers need CORS

What is a VPC: your own private network inside one AWS Region, example ThreeTierVpc 10.0.0.0/16.

Why browsers need CORS curl works; the browser blocks. Students think the API is down. Same-Origin Policy. Cross-origin calls need Access-Control-Allow-* headers. Enable CORS on the HTTP API; return Allow-Origin in Lambda too for proxy. UI on CloudFront, API on execute-api → both origins differ → CORS required.
Why browsers need CORS · Download PNG
Read card text

What this card says

Why do we need it?

curl works; the browser blocks. Students think the API is down.

What is it?

Same-Origin Policy. Cross-origin calls need Access-Control-Allow-* headers.

How to do it

Enable CORS on the HTTP API; return Allow-Origin in Lambda too for proxy.

Access-Control-Allow-Origin

Example

UI on CloudFront, API on execute-api → both origins differ → CORS required.

See all AWS revision cards