Skip to content

Commit

Permalink
allow content-type headers in requests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucat1 committed Dec 28, 2023
1 parent 1b8a727 commit 62a9d40
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ mod internal;
pub mod jsonapi;
mod tempo;

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

0 comments on commit 62a9d40

Please sign in to comment.