1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
pub struct Cors { orgins: Vec<String>, } impl Cors { pub fn new_all() -> Self { Self { orgins: vec!["*".to_string()], } } pub fn new_whitelist(whitelist: Vec<String>) -> Self { Self { orgins: whitelist } } }