From 38101afe8e7fc268f63b2eb873b3065366e4615e Mon Sep 17 00:00:00 2001 From: zzzz Date: Sun, 16 Jun 2024 17:19:25 +0200 Subject: [PATCH] added `allow_headers` call --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3ff5ef2..09202ef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,8 +3,7 @@ // cargo shuttle resource list --show-secrets use axum::{ - routing::{get, post, put, delete}, - Router, + http, routing::{delete, get, post, put}, Router }; use axum::http::Method; use data::MyState; @@ -47,6 +46,7 @@ async fn main(#[shuttle_shared_db::Postgres] pool: PgPool) -> shuttle_axum::Shut .with_state(state) .layer(tower_http::cors::CorsLayer::new() .allow_methods([Method::GET, Method::POST, Method::PUT, Method::DELETE]) + .allow_headers([http::header::CONTENT_TYPE]) .allow_origin(tower_http::cors::Any)); Ok(router.into())