mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-17 21:41:20 +00:00
feat: CORS in production
This commit is contained in:
parent
214fb72b83
commit
55a31649ae
1 changed files with 10 additions and 1 deletions
|
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue