#[non_exhaustive]pub struct CorsConfig {
pub origins: Vec<String>,
pub expose_headers: Vec<String>,
pub max_age_secs: Option<u64>,
pub grpc_web: bool,
}Expand description
CORS configuration.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.origins: Vec<String>Allowed origins. Empty = permissive (dev mode).
expose_headers: Vec<String>Response headers a browser script may read on top of the ones the
proxy always exposes (grpc-status, grpc-message,
grpc-status-details-bin and the rate-limit headers): typically
upstream metadata forwarded as a header, such as x-request-id.
max_age_secs: Option<u64>How long a browser may cache a preflight answer, in seconds. Unset, the browser’s own default applies.
grpc_web: boolApply this policy to gRPC-Web calls that pass through to the upstream and to their preflights, so a browser gets one policy for both (on by default). Off only for an upstream that sets CORS on gRPC-Web itself: its preflights then reach the upstream as well.
Trait Implementations§
Source§impl Clone for CorsConfig
impl Clone for CorsConfig
Source§impl Debug for CorsConfig
impl Debug for CorsConfig
Source§impl Default for CorsConfig
impl Default for CorsConfig
Source§impl<'de> Deserialize<'de> for CorsConfig
impl<'de> Deserialize<'de> for CorsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request