Skip to content

Commit

Permalink
fix another CORS issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lucat1 committed Dec 28, 2023
1 parent 62a9d40 commit 10982eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub use error::Error;
use eyre::Result;
use sea_orm::DbConn;
use tower_http::{
cors::{Any, CorsLayer},
cors::{AllowOrigin, Any, CorsLayer},
trace::TraceLayer,
};

Expand All @@ -25,7 +25,7 @@ pub struct AppState(pub DbConn);
pub fn router() -> Result<Router> {
let cors = CorsLayer::new()
.allow_methods(Any)
.allow_origin(Any)
.allow_origin(AllowOrigin::mirror_request())
.allow_headers([AUTHORIZATION, ACCEPT, CONTENT_TYPE]);
let tracing = TraceLayer::new_for_http();
let conn = get_database()?.clone();
Expand Down

0 comments on commit 10982eb

Please sign in to comment.