Type Alias rocket_cors::AllowedHeaders

source ·
pub type AllowedHeaders = AllOrSome<HashSet<HeaderFieldName>>;
Expand description

A list of allowed headers

Examples

use rocket_cors::AllowedHeaders;

let all_headers = AllowedHeaders::all();
let some_headers = AllowedHeaders::some(&["Authorization", "Accept"]);

Aliased Type§

enum AllowedHeaders {
    All,
    Some(HashSet<HeaderFieldName>),
}

Variants§

§

All

Everything is allowed. Usually equivalent to the “*” value.

§

Some(HashSet<HeaderFieldName>)

Only some of T is allowed

Implementations§

source§

impl AllowedHeaders

source

pub fn some(headers: &[&str]) -> Self

Allow some headers

source

pub fn all() -> Self

Allows all headers