pub struct CorsConfig {
pub origins: Vec<String>,
pub methods: Vec<String>,
pub headers: Vec<String>,
pub allow_credentials: bool,
pub max_age: u32,
}Expand description
CORS configuration loaded from appsettings.json.
Fields§
§origins: Vec<String>Allowed origins. Use "*" to allow any origin.
methods: Vec<String>Allowed HTTP methods (default: GET, POST, PUT, DELETE, OPTIONS).
headers: Vec<String>Allowed request headers.
allow_credentials: boolWhether credentials (cookies) are allowed.
max_age: u32Max age for preflight cache (seconds).
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CorsConfig
impl Debug for CorsConfig
Source§impl Default for CorsConfig
impl Default for CorsConfig
Source§fn default() -> CorsConfig
fn default() -> CorsConfig
Returns the “default value” for a type. Read more
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