Struct poem::middleware::Cors
source[−]pub struct Cors { /* private fields */ }
Expand description
Implementations
Set allow credentials.
Add an allow header.
NOTE: Default is allow any header.
pub fn allow_headers<I, T>(self, headers: I) -> Self where
I: IntoIterator<Item = T>,
HeaderName: TryFrom<T>,
pub fn allow_headers<I, T>(self, headers: I) -> Self where
I: IntoIterator<Item = T>,
HeaderName: TryFrom<T>,
Add many allow headers.
Add an allow method.
NOTE: Default is allow any method.
pub fn allow_methods<I, T>(self, methods: I) -> Self where
I: IntoIterator<Item = T>,
Method: TryFrom<T>,
pub fn allow_methods<I, T>(self, methods: I) -> Self where
I: IntoIterator<Item = T>,
Method: TryFrom<T>,
Add many allow methods.
Add an allow origin.
NOTE: Default is allow any origin.
pub fn allow_origins<I, T>(self, origins: I) -> Self where
I: IntoIterator<Item = T>,
HeaderValue: TryFrom<T>,
pub fn allow_origins<I, T>(self, origins: I) -> Self where
I: IntoIterator<Item = T>,
HeaderValue: TryFrom<T>,
Add many allow origins.
Determinate allowed origins by processing requests which didn’t match
any origins specified in the allow_origin
.
This function will receive the Origin
header, which can be used to
determine whether to allow the request.
Add an expose header.
pub fn expose_headers<I, T>(self, headers: I) -> Self where
I: IntoIterator<Item = T>,
HeaderName: TryFrom<T>,
pub fn expose_headers<I, T>(self, headers: I) -> Self where
I: IntoIterator<Item = T>,
HeaderName: TryFrom<T>,
Add many expose headers.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Cors
impl !UnwindSafe for Cors
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more