"(Reason: CORS header ‘Access-Control-Allow-Origin’ missing)" while trying to access Actix webserver from Wix site

24 Views Asked by At

I have a webserver that is hosted on Shuttle.io when I try to access it from a Wix site via javascirpt I get "(Reason: CORS header ‘Access-Control-Allow-Origin’ missing)" errors.

I set up cors for my webserver in 2 different ways: 1.

let config = move |cfg: &mut ServiceConfig| {
        let cors = Cors::permissive();
        cfg.service(web::scope("/").service(get_advice).wrap(cors).wrap(Governor::new(&governor_conf)));
    };
let config = move |cfg: &mut ServiceConfig| {
        let cors =      Cors::default().allow_any_header().allow_any_method().allow_any_origin().send_wildcard();
        cfg.service(web::scope("/").service(get_advice).wrap(cors).wrap(Governor::new(&governor_conf)));
    };

I get the same error with both configuratios

0

There are 0 best solutions below