Enum corsware::AllowedOrigins
[−]
[src]
pub enum AllowedOrigins { Any { allow_null: bool, }, Specific(HashSet<Origin>), }
Specifies which origins are allowed to access this resource
Variants
Any
Any origin is allowed.
Fields of Any
allow_null: bool | Allowing a null origin is a separate setting, since it's risky to trust sources with a null origin, see https://tools.ietf.org/id/draft-abarth-origin-03.html#rfc.section.6 https://w3c.github.io/webappsec-cors-for-developers/ |
Specific(HashSet<Origin>)
Allow a specific set of origins. Remember that allowing for a null header is risky.
Methods
impl AllowedOrigins
[src]
fn allowed_for(
&self,
origin_string: &str,
allow_credentials: bool,
prefer_wildcard: bool
) -> Option<String>
[src]
&self,
origin_string: &str,
allow_credentials: bool,
prefer_wildcard: bool
) -> Option<String>
Returns the value of AccessControlAllowOrigin given the specified Origin header in the request. The allow_credentials flag is supplied since AccessControlAllowOrigin * is forbidden when credentials are allowed.
We're not using the iron Origin header to construct an origin directly, since we are dependent on url.port_or_known_default() to get the default port. This method is only available after parsing the Origin header to an URL.
Trait Implementations
impl Clone for AllowedOrigins
[src]
fn clone(&self) -> AllowedOrigins
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more