<img> <video>
<script>.
The cross-origin resource sharing specification provides controlled relaxation of the same-origin policy. The CORS specification identifies a collection of protocol headers
Origin header added by the browser.
Origin : https://normal-website.comAccess-Control-Allow-Origin returned by a server
when a website requests a cross-domain resource.
Access-Control-Allow-Origin: https://normal-website.comThis means that the browser will allow code running on normal-website.com to access the response because the origins match.
Note:
Access-Control-Allow-Originis returned only if the whitelisted values or*ornullmatched the Origin.
Access-Control-Allow-Origin: *
The use of the wildcard * is restricted in the
specification as you cannot combine the wildcard with the
cross-origin transfer of credentials (authentication, cookies or
client-side certificates). This following response is not
permitted
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: null
Specifies that only origins with a null origin are
allowed to access the resource. Browsers might send the value
null in the Origin header in various unusual
situations:
file protocol.Under certain circumstances, when a cross-domain request includes a non-standard HTTP method or headers, the cross-origin request is preceded by a request using the OPTIONS method.
For example, this is a pre-flight request that is seeking to use the PUT method together with a custom request header called Special-Request-Header
OPTIONS /data HTTP/1.1
Host: <some website>
[...]
Origin: https://normal-website.com
Access-Control-Request-Method: PUT
Access-Control-Request-Headers: Special-Request-Header
HTTP/1.1 204 No Content
[...]
Access-Control-Allow-Origin: https://normal-website.com
Access-Control-Allow-Methods: PUT, POST, OPTIONS
Access-Control-Allow-Headers: Special-Request-Header
Access-Control-Allow-Credentials: true
Access-Control-Max-Age: 240
PUT,
POST and OPTIONS) and permitted request
headers (Special-Request-Header). In this particular
case the cross-domain server also allows the sending of credentials
(authentication, cookies or client-side certificates), and the
Access-Control-Max-Age header defines a maximum timeframe for
caching the pre-flight response for reuse.