CorsOptions¶
Import: import system.webapi;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
CorsOptions¶
FastAPI / Starlette CORSMiddleware options. Origins, methods, and headers are comma-separated ("*" means any). allow_credentials cannot be combined with origin * (the request Origin is echoed instead, matching Starlette).
allow_origins¶
Allowed request origins, or * for any origin.
allow_methods¶
Allowed HTTP methods, or * to allow all.
allow_headers¶
Allowed request headers, or * to allow all.
expose_headers¶
Response headers that browsers may expose to cross-origin callers.
allow_credentials¶
Whether cross-origin requests may include credentials.
max_age¶
How long browsers may cache preflight results, in seconds.
constructor¶
Creates a CorsOptions with allow_origins, allow_methods, allow_headers, expose_headers, allow_credentials, max_age.