pub struct CorsConfig {
pub allow_origins: AllowOrigins,
pub allow_methods: Vec<Method>,
pub allow_headers: Vec<HeaderName>,
pub allow_credentials: bool,
pub max_age: Option<u32>,
pub expose_headers: Vec<HeaderName>,
}Expand description
Configuration for CORS behavior.
See MDN CORS for details.
Fields§
§allow_origins: AllowOriginsWhich origins are allowed to make requests.
allow_methods: Vec<Method>HTTP methods allowed in preflight and actual requests.
allow_headers: Vec<HeaderName>Request headers allowed in preflight.
allow_credentials: boolWhether to allow credentials (cookies, HTTP auth, etc).
Important: When true, allow_origins cannot be Any - browsers reject *.
max_age: Option<u32>How long (in seconds) the preflight response can be cached.
expose_headers: Vec<HeaderName>Headers that should be exposed to the client JavaScript.
Trait Implementations§
Source§impl Clone for CorsConfig
impl Clone for CorsConfig
Source§fn clone(&self) -> CorsConfig
fn clone(&self) -> CorsConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CorsConfig
impl RefUnwindSafe for CorsConfig
impl Send for CorsConfig
impl Sync for CorsConfig
impl Unpin 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