pub struct CorsConfig {
pub allowed_origins: Vec<String>,
pub allowed_methods: Vec<String>,
pub allowed_headers: Vec<String>,
pub exposed_headers: Vec<String>,
pub allow_credentials: bool,
pub max_age: u64,
pub enabled: bool,
}Expand description
Configuration for CORS middleware.
Fields§
§allowed_origins: Vec<String>Allowed origins. An empty list means no CORS headers are added.
Use ["*"] to allow all origins (not recommended for production).
allowed_methods: Vec<String>Allowed HTTP methods. Defaults to common auth methods.
allowed_headers: Vec<String>Allowed request headers.
exposed_headers: Vec<String>Headers exposed to the browser.
allow_credentials: boolWhether credentials (cookies, authorization) are allowed.
max_age: u64Max age for preflight cache (seconds).
enabled: boolWhether CORS handling is enabled.
Implementations§
Trait Implementations§
Source§impl Clone for CorsConfig
impl Clone for CorsConfig
Source§impl Debug for CorsConfig
impl Debug for CorsConfig
Auto Trait Implementations§
impl Freeze for CorsConfig
impl RefUnwindSafe for CorsConfig
impl Send for CorsConfig
impl Sync for CorsConfig
impl Unpin for CorsConfig
impl UnsafeUnpin for CorsConfig
impl UnwindSafe for CorsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more