Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same-origin policy and Cross-origin resource sharing (CORS) #80

Open
ajhsu opened this issue Oct 8, 2018 · 0 comments
Open

Same-origin policy and Cross-origin resource sharing (CORS) #80

ajhsu opened this issue Oct 8, 2018 · 0 comments

Comments

@ajhsu
Copy link
Owner

ajhsu commented Oct 8, 2018

Same-origin policy

Definition of "Same-origin policy" on MDN

The same-origin policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin. It helps to isolate potentially malicious documents, reducing possible attack vectors.

Definition of "Same-origin policy" on Wikipedia

In computing, the same-origin policy is an important concept in the web application security model. Under the policy, a web browser permits scripts contained in a first web page to access data in a second web page, but only if both web pages have the same origin.

Note that some of embedding resource CAN BE LOADED cross-origin, such as <script src="..."></script>, <img src="..." />, <video>, <audio> and so on .

Cross-origin resource sharing

Definition of "CORS" on MDN

Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell a browser to let a web application running at one origin (domain) have permission to access selected resources from a server at a different origin. A web application makes a cross-origin HTTP request when it requests a resource that has a different origin (domain, protocol, and port) than its own origin.

Definition of "CORS" on Wikipedia

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource was served.

Abstract of "CORS" from W3C Specification

This document defines a mechanism to enable client-side cross-origin requests. Specifications that enable an API to make cross-origin requests to resources can use the algorithms defined by this specification. If such an API is used on http://example.org resources, a resource on http://hello-world.example can opt in using the mechanism described by this specification (e.g., specifying Access-Control-Allow-Origin: http://example.org as response header), which would allow that resource to be fetched cross-origin from http://example.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant