Skip to content

Commit a7970ec

Browse files
committed
don't use wildcard for CORS allow headers
1 parent 8b7c33d commit a7970ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/api/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ mod internal;
66
pub mod jsonapi;
77
mod tempo;
88

9-
use axum::Router;
9+
use axum::{Router, http::header::{ACCEPT, AUTHORIZATION}};
1010
use base::database::get_database;
1111
pub use error::Error;
1212
use eyre::Result;
@@ -23,7 +23,7 @@ pub fn router() -> Result<Router> {
2323
let cors = CorsLayer::new()
2424
.allow_methods(Any)
2525
.allow_origin(Any)
26-
.allow_headers(Any);
26+
.allow_headers([AUTHORIZATION, ACCEPT]);
2727
let tracing = TraceLayer::new_for_http();
2828
let conn = get_database()?.clone();
2929
Ok(Router::new()

0 commit comments

Comments
 (0)