Type Definition rocket_cors::AllowedOrigins

source ·
pub type AllowedOrigins = AllOrSome<HashSet<Url>>;
Expand description

A list of allowed origins. Either Some origins are allowed, or all origins are allowed.

Examples

use rocket_cors::AllowedOrigins;

let all_origins = AllowedOrigins::all();
let (some_origins, failed_origins) = AllowedOrigins::some(&["https://www.acme.com"]);
assert!(failed_origins.is_empty());

Implementations

Allows some origins

Returns a tuple where the first element is the struct AllowedOrigins, and the second element is a map of strings which failed to parse into URLs and their associated parse errors.

Allows all origins