Book Image

CORS Essentials

By : Rajesh Gunasundaram
Book Image

CORS Essentials

By: Rajesh Gunasundaram

Overview of this book

This book explains how to use CORS, including specific implementations for platforms such as Drupal, WordPress, IIS Server, ASP.NET, JBoss, Windows Azure, and Salesforce, as well as how to use CORS in the Cloud on Amazon AWS, YouTube, Mulesoft, and others. It examines limitations, security risks, and alternatives to CORS. It explores the W3C Specification and major developer documentation sources about CORS. It attempts to predict what kinds of extension to the CORS specification, or completely new techniques, will come in the future to address the limitations of CORS Web developers will learn how to share code and assets across domains with CORS. They will learn a variety of techniques that are rather similar in their method and syntax. The book is organized by similar types of framework and application, so it can be used as a reference. Developers will learn about special cases, such as when a proxy is necessary. And they will learn about some alternative techniques that achieve similar goals, and when they may be preferable to using CORS
Table of Contents (15 chapters)
CORS Essentials
Credits
About the Authors
www.PacktPub.com
Customer Feedback
Preface
Index

CORS in Amazon Simple Storage Service (S3)


Amazon Simple Storage Service (Amazon S3) provides developers and IT teams with secure, durable, highly-scalable object storage.

Scenarios for needing CORS in Amazon S3

  • You are hosting a website in an Amazon S3 bucket named website. Browsers load the website endpoint, . You want to use JavaScript on the web pages that are stored in this bucket to be able to make authenticated GET and PUT requests against the same bucket by using Amazon S3's API endpoint for the bucket . The same origin policy in a browser would normally block JavaScript from allowing those requests, but with CORS you can configure your bucket to allow cross-origin requests from website.s3-website-us-east-1.amazonaws.com (as the local domain) to the endpoint (as the target domain).

  • You want to host a web font on your S3 bucket. Browsers require a CORS preflight check for loading web fonts, so you would configure the bucket that is hosting the web font to allow your web application...