xxxxxxxxxx
use actix_cors::Cors;
use actix_web::http::header;
let cors = Cors::default()
.allowed_origin("https://www.rust-lang.org")
.allowed_methods(vec!["GET", "POST"])
.allowed_headers(vec![header::AUTHORIZATION, header::ACCEPT])
.allowed_header(header::CONTENT_TYPE)
.max_age(3600);
// `cors` can now be used in `App::wrap`.