Difference between revisions of "Cross-Origin Resource Sharing (CORS)"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Draft}}
+
[[wikipedia:Cross-Origin Resource Sharing]] 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.
[[wikipedia:Cross-Origin Resource Sharing]]
+
 
 +
Example:
 +
<pre>
 +
[
 +
    {
 +
        "AllowedHeaders": [
 +
            "*"
 +
        ],
 +
        "AllowedMethods": [
 +
            "PUT",
 +
            "POST"
 +
        ],
 +
        "AllowedOrigins": [
 +
            "*"
 +
        ],
 +
        "ExposeHeaders": [],
 +
        "MaxAgeSeconds": 3000
 +
    }
 +
]
 +
</pre>
 +
 
 +
 
 +
[
 +
    {
 +
        "AllowedHeaders": [
 +
            "*"
 +
        ],
 +
        "AllowedMethods": [
 +
            "PUT",
 +
            "POST",
 +
            "GET",
 +
            "DELETE"
 +
        ],
 +
        "AllowedOrigins": [
 +
            "*"
 +
        ],
 +
        "ExposeHeaders": [
 +
            "[[ETag]]"
 +
        ],
 +
        "MaxAgeSeconds": 3000
 +
    }
 +
]
 +
 
 +
 
 +
== Errors ==
 +
* <code>[[has been blocked by CORS policy]]</code>
  
  
 
== Related terms ==
 
== Related terms ==
 
* [[AWS API Gateway]]
 
* [[AWS API Gateway]]
 +
* [[HSTS]]
 +
* [[Tellme Networks]]
 +
* [[Caddyfile]]
 +
* <code>[[gsutil cors]]</code>
 +
* [[Terraform resource: aws cloudfront origin access control]]
 +
* [[CORS (golang)]]
 +
* [[geth --http --http.corsdomain]]
  
 
== See also ==
 
== See also ==
 +
* {{HTTP methods}}
 
* {{CSRF}}
 
* {{CSRF}}
 
* {{W3C}}
 
* {{W3C}}

Latest revision as of 12:37, 27 October 2024

wikipedia:Cross-Origin Resource Sharing 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.

Example:

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "PUT",
            "POST"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [],
        "MaxAgeSeconds": 3000
    }
]


[
   {
       "AllowedHeaders": [
           "*"
       ],
       "AllowedMethods": [
           "PUT",
           "POST",
           "GET",
           "DELETE"
       ],
       "AllowedOrigins": [
           "*"
       ],
       "ExposeHeaders": [
           "ETag"
       ],
       "MaxAgeSeconds": 3000
   }
]


Errors[edit]


Related terms[edit]

See also[edit]

Advertising: