mirror of
https://github.com/zzzzDev4/ias-tea-axum.git
synced 2025-04-21 07:41:21 +02:00
added allow_headers
call
This commit is contained in:
parent
ef5bcb20a5
commit
38101afe8e
1 changed files with 2 additions and 2 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Reference in a new issue