feat: CORS in production

This commit is contained in:
Sebastian Pravda 2022-12-14 18:31:31 +01:00
parent 214fb72b83
commit 55a31649ae
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57

View file

@ -47,7 +47,16 @@ impl Fairing for CORS {
#[cfg(not(debug_assertions))]
async fn on_response<'r>(&self, _request: &'r Request<'_>, response: &mut Response<'r>) {
// TODO
response.set_header(Header::new(
"Access-Control-Allow-Origin",
"https://portfolio.ssps.cz", // TODO: UPRAVIT NA PRODUKČNÍ URL!!
));
response.set_header(Header::new(
"Access-Control-Allow-Methods",
"POST, GET, OPTIONS, DELETE",
));
response.set_header(Header::new("Access-Control-Allow-Headers", "content-type"));
response.set_header(Header::new("Access-Control-Allow-Credentials", "true"));
}
}