The following is about using CORS example scenario:
-
Scenario 1: Let's say you named
website
hosting site in Amazon S3 buckets (like hosting static Web site on Amazon S3 in the). Your user to load a site terminal nodehttp://website.s3-website-us-east-1.amazonaws.com
. Now, you want to use JavaScript on pages this bucket stored in order to be able to use Amazon S3 API terminal nodes that bucket ofwebsite.s3.amazonaws.com
issuing an authenticated GET and PUT requests to the same bucket. Browsers usually allow these requests to block JavaScript, but with CORS, you can configure your buckets to explicitly support from awebsite.s3-website-us-east-1.amazonaws.com
cross-origin requests. -
Scenario 2: Suppose you want to hosting your S3 bucket from a Web fonts. Browser will ask again for being loaded Web fonts CORS inspection (also called preflight). You can configure the hosting Web fonts bucket to allow any source issue these requests.