Cross-Origin Resource Sharing: Use case scenario CORS

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 node  http://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 of  website.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 a  website.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.

Guess you like

Origin www.cnblogs.com/cloudrivers/p/11620462.html