]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
✏️ Clarify docs on CORS (#5627)
authorPax <13646646+paxcodes@users.noreply.github.com>
Sun, 13 Nov 2022 20:28:37 +0000 (12:28 -0800)
committerGitHub <noreply@github.com>
Sun, 13 Nov 2022 20:28:37 +0000 (21:28 +0100)
docs/en/docs/tutorial/cors.md

index 4ab3da3b4fb46987afa6079928de2ef43ea3cf0e..33b11983b32b5c22806054227a8caa12436ef8d0 100644 (file)
@@ -57,7 +57,7 @@ The following arguments are supported:
 * `allow_origins` - A list of origins that should be permitted to make cross-origin requests. E.g. `['https://example.org', 'https://www.example.org']`. You can use `['*']` to allow any origin.
 * `allow_origin_regex` - A regex string to match against origins that should be permitted to make cross-origin requests. e.g. `'https://.*\.example\.org'`.
 * `allow_methods` - A list of HTTP methods that should be allowed for cross-origin requests. Defaults to `['GET']`. You can use `['*']` to allow all standard methods.
-* `allow_headers` - A list of HTTP request headers that should be supported for cross-origin requests. Defaults to `[]`. You can use `['*']` to allow all headers. The `Accept`, `Accept-Language`, `Content-Language` and `Content-Type` headers are always allowed for CORS requests.
+* `allow_headers` - A list of HTTP request headers that should be supported for cross-origin requests. Defaults to `[]`. You can use `['*']` to allow all headers. The `Accept`, `Accept-Language`, `Content-Language` and `Content-Type` headers are always allowed for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests" class="external-link" rel="noopener" target="_blank">simple CORS requests</a>.
 * `allow_credentials` - Indicate that cookies should be supported for cross-origin requests. Defaults to `False`. Also, `allow_origins` cannot be set to `['*']` for credentials to be allowed, origins must be specified.
 * `expose_headers` - Indicate any response headers that should be made accessible to the browser. Defaults to `[]`.
 * `max_age` - Sets a maximum time in seconds for browsers to cache CORS responses. Defaults to `600`.