pub struct CorsMiddleware { /* private fields */ }Expand description
Built-in CORS middleware.
Reads config from appsettings.json →Cors section at build time
and applies CORS headers to every response. Handles preflight OPTIONS.
Implementations§
Source§impl CorsMiddleware
impl CorsMiddleware
Sourcepub fn new(config: CorsConfig) -> Self
pub fn new(config: CorsConfig) -> Self
Create a new CORS middleware with the given configuration.
Trait Implementations§
Source§impl IMiddleware for CorsMiddleware
impl IMiddleware for CorsMiddleware
Auto Trait Implementations§
impl Freeze for CorsMiddleware
impl RefUnwindSafe for CorsMiddleware
impl Send for CorsMiddleware
impl Sync for CorsMiddleware
impl Unpin for CorsMiddleware
impl UnsafeUnpin for CorsMiddleware
impl UnwindSafe for CorsMiddleware
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