pub struct CorsConfig {
pub allowed_origins: Vec<String>,
pub allowed_methods: Vec<String>,
pub allowed_headers: Vec<String>,
pub max_age: u32,
}Expand description
CORS configuration.
Fields§
§allowed_origins: Vec<String>Allowed origins. Use ["*"] for any origin.
allowed_methods: Vec<String>Allowed HTTP methods.
allowed_headers: Vec<String>Allowed request headers.
max_age: u32Max age for preflight cache (seconds).
Implementations§
Source§impl CorsConfig
impl CorsConfig
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Create a permissive CORS config (allow all origins).
Sourcepub fn with_origins(origins: Vec<String>) -> Self
pub fn with_origins(origins: Vec<String>) -> Self
Create a CORS config restricted to specific origins.
Trait Implementations§
Source§impl Clone for CorsConfig
impl Clone for CorsConfig
Source§impl Debug for CorsConfig
impl Debug for CorsConfig
Auto Trait Implementations§
impl Forget for CorsConfig
impl Freeze for CorsConfig
impl Move for CorsConfig
impl RefUnwindSafe for CorsConfig
impl Send for CorsConfigwhere
RawVecInner: Send,
impl Sync for CorsConfigwhere
RawVecInner: Sync,
impl Unpin for CorsConfig
impl UnsafeUnpin for CorsConfig
impl UnwindSafe for CorsConfigwhere
RawVecInner: UnwindSafe,
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