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 origin is allowed.

Fields of Any

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/

Allow a specific set of origins. Remember that allowing for a null header is risky.

Methods

impl AllowedOrigins
[src]

[src]

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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more