From 62a9d402e7e97442e779b825486c94ee5c278355 Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 28 Dec 2023 11:08:27 +0100 Subject: [PATCH] allow content-type headers in requests --- server/src/api/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/src/api/mod.rs b/server/src/api/mod.rs index 0102034..240fd32 100644 --- a/server/src/api/mod.rs +++ b/server/src/api/mod.rs @@ -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; @@ -23,7 +26,7 @@ pub fn router() -> Result { 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()