...

/

Working With Cross-Origin Resource Sharing

Working With Cross-Origin Resource Sharing

In this lesson, you will learn how to work with cross-origin resource sharing when using AWS Lambda.

Cross-origin resource sharing (CORS) #

Client code will need to access resources from S3 and API Gateway, which will be on different domains. To prevent online fraud, browsers request special authorisation when a page from one domain wants to access resources on another domain. This is cross-origin resource sharing (CORS). Here’s a quick introduction to how CORS works. It should be enough for your needs in this course (for a more in-depth introduction to CORS, check out the Cross-Origin Resource Sharing documentation page on the Mozilla Developer Network):

An origin, in browser terminology, is a combination of URL protocol, domain and, optionally, network port. So, for example, the origin https://runningserverless.com is distinct from https://gojko.net. Browsers will happily load scripts or images from a different origin during primary web page parsing, but they will not ...