Skip to content

Commit

Permalink
allow cloudflare worker cors
Browse files Browse the repository at this point in the history
  • Loading branch information
wyatt-avilla committed Jun 22, 2024
1 parent 9ddd80c commit c789750
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ async fn main() -> ShuttleActixWeb<impl FnOnce(&mut ServiceConfig) + Send + Clon
let config = move |cfg: &mut ServiceConfig| {
let cors = Cors::default()
.allowed_origin(ENDPOINT.base)
.allowed_origin("https://wyatt.wtf") // required by cloudflare worker
.allowed_origin("https://www.wyatt.wtf")
.allowed_methods(vec!["GET", "POST"])
.allowed_headers(vec![http::header::CONTENT_TYPE])
.max_age(3600);
Expand Down

0 comments on commit c789750

Please sign in to comment.