pub struct CorsPolicy {
pub allow_credentials: Option<bool>,
pub allow_headers: Option<Vec<String>>,
pub allow_methods: Option<Vec<String>>,
pub allow_origin_regexes: Option<Vec<String>>,
pub allow_origins: Option<Vec<String>>,
pub disabled: Option<bool>,
pub expose_headers: Option<Vec<String>>,
pub max_age: Option<i32>,
}Expand description
The specification for allowing client-side cross-origin requests. For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard.
This type is not used in any activity, and only used as part of another schema.
Fields§
§allow_credentials: Option<bool>In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This field translates to the Access-Control-Allow-Credentials header. Default is false.
allow_headers: Option<Vec<String>>Specifies the content for the Access-Control-Allow-Headers header.
allow_methods: Option<Vec<String>>Specifies the content for the Access-Control-Allow-Methods header.
allow_origin_regexes: Option<Vec<String>>Specifies a regular expression that matches allowed origins. For more information, see regular expression syntax . An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED.
allow_origins: Option<Vec<String>>Specifies the list of origins that is allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
disabled: Option<bool>If true, disables the CORS policy. The default value is false, which indicates that the CORS policy is in effect.
expose_headers: Option<Vec<String>>Specifies the content for the Access-Control-Expose-Headers header.
max_age: Option<i32>Specifies how long results of a preflight request can be cached in seconds. This field translates to the Access-Control-Max-Age header.
Trait Implementations§
Source§impl Clone for CorsPolicy
impl Clone for CorsPolicy
Source§fn clone(&self) -> CorsPolicy
fn clone(&self) -> CorsPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CorsPolicy
impl Debug for CorsPolicy
Source§impl Default for CorsPolicy
impl Default for CorsPolicy
Source§fn default() -> CorsPolicy
fn default() -> CorsPolicy
Source§impl<'de> Deserialize<'de> for CorsPolicy
impl<'de> Deserialize<'de> for CorsPolicy
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>,
Source§impl Serialize for CorsPolicy
impl Serialize for CorsPolicy
impl Part for CorsPolicy
Auto Trait Implementations§
impl Freeze for CorsPolicy
impl RefUnwindSafe for CorsPolicy
impl Send for CorsPolicy
impl Sync for CorsPolicy
impl Unpin for CorsPolicy
impl UnwindSafe for CorsPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more