]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Add note in CORS tutorial about allow_origins with ["*"] and allow_credentials...
authorDaniel Murrell <dsmurrell@gmail.com>
Thu, 5 Nov 2020 21:03:45 +0000 (21:03 +0000)
committerGitHub <noreply@github.com>
Thu, 5 Nov 2020 21:03:45 +0000 (22:03 +0100)
docs/en/docs/tutorial/cors.md

index 6a694995a181acbc29003b7f714d41c0d9db02da..50b83969bcf952071d968cf817fd8fb068faca32 100644 (file)
@@ -58,7 +58,7 @@ The following arguments are supported:
 * `allow_origin_regex` - A regex string to match against origins that should be permitted to make cross-origin requests. eg. `'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_credentials` - Indicate that cookies should be supported for cross-origin requests. Defaults to `False`.
+* `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`.