Skip to content

Commit

Permalink
don't use wildcard for CORS allow headers
Browse files Browse the repository at this point in the history
  • Loading branch information
lucat1 committed Dec 13, 2023
1 parent 8b7c33d commit a7970ec
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 @@ -6,7 +6,7 @@ mod internal;
pub mod jsonapi;
mod tempo;

use axum::Router;
use axum::{Router, http::header::{ACCEPT, AUTHORIZATION}};
use base::database::get_database;
pub use error::Error;
use eyre::Result;
Expand All @@ -23,7 +23,7 @@ pub fn router() -> Result<Router> {
let cors = CorsLayer::new()
.allow_methods(Any)
.allow_origin(Any)
.allow_headers(Any);
.allow_headers([AUTHORIZATION, ACCEPT]);
let tracing = TraceLayer::new_for_http();
let conn = get_database()?.clone();
Ok(Router::new()
Expand Down

0 comments on commit a7970ec

Please sign in to comment.