mirror of
https://github.com/Steffo99/distributed-arcade.git
synced 2024-11-21 15:44:26 +00:00
Fix CORS headers
This commit is contained in:
parent
c723701425
commit
10de3bd848
1 changed files with 10 additions and 1 deletions
11
src/main.rs
11
src/main.rs
|
@ -29,7 +29,16 @@ async fn main() {
|
||||||
.route("/score/", put(routes::score::route_score_put))
|
.route("/score/", put(routes::score::route_score_put))
|
||||||
.layer(axum::Extension(rclient))
|
.layer(axum::Extension(rclient))
|
||||||
.layer(tower_http::cors::CorsLayer::new()
|
.layer(tower_http::cors::CorsLayer::new()
|
||||||
.allow_origin("*".parse::<axum::http::HeaderValue>().expect("* to be a valid origin"))
|
.allow_origin(
|
||||||
|
tower_http::cors::Any
|
||||||
|
)
|
||||||
|
.allow_headers([
|
||||||
|
axum::http::header::AUTHORIZATION,
|
||||||
|
axum::http::header::CONTENT_TYPE,
|
||||||
|
])
|
||||||
|
.allow_methods(
|
||||||
|
tower_http::cors::Any
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
log::info!("Starting Axum server...");
|
log::info!("Starting Axum server...");
|
||||||
|
|
Loading…
Reference in a new issue