CorsConfig
struct CorsConfigConfiguration knobs for Cors[Inner].
Default policy: deny everything (every list empty,
allow_credentials=False). Mutate via the named-arg
constructor or by setting fields after default-construction.
Implements Copyable, Defaultable, Movable
- Fields
allowed_origins: List[String]: Origins permitted to send cross-origin requests.["*"]is the wildcard. Empty list -> no origin allowed.allowed_methods: List[String]: Methods echoed inAccess-Control-Allow-Methodson preflight. Defaults to["GET", "HEAD", "POST"].allowed_headers: List[String]: Headers echoed inAccess-Control-Allow-Headerson preflight. Empty -> echoed from the inboundAccess-Control-Request-Headers.exposed_headers: List[String]: Headers attached toAccess-Control-Expose-Headerson actual responses (so JS can read them).max_age_seconds: Int:Access-Control-Max-Age(seconds the preflight result is cacheable). Default 600.allow_credentials: Bool: WhenTrue,Access-Control-Allow-Credentials: trueis set; the wildcard origin is not used (spec requirement).
__init__
def __init__(out self) permissive
def permissive() -> Self Wildcard-everything config — convenient for local dev / public APIs without credentials.