Skip to content

Commit

Permalink
Fix cors for site
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinrouillard committed Oct 6, 2024
1 parent 8b30c04 commit 7b018e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ async fn main() -> Result<(), Box<dyn Error>> {

let api_server = HttpServer::new(move || {
let cors = Cors::default()
.allowed_origin_fn(|origin, _req_head| {
origin.as_bytes().ends_with(b"dstn.to")
})
.allowed_origin_fn(|origin, _req_head| {
origin.as_bytes().ends_with(b".dstn.to")
})
Expand Down

0 comments on commit 7b018e4

Please sign in to comment.