Refactor SelectField and allow headers with CORS
This commit is contained in:
parent
e9945a19d5
commit
9919e0c16e
6 changed files with 84 additions and 108 deletions
|
|
@ -3,7 +3,10 @@ use std::{env, net::SocketAddr, sync::Arc};
|
|||
use axum::{
|
||||
error_handling::HandleErrorLayer,
|
||||
extract,
|
||||
http::{HeaderValue, Method},
|
||||
http::{
|
||||
header::{ACCEPT, AUTHORIZATION, CONTENT_TYPE},
|
||||
HeaderValue, Method,
|
||||
},
|
||||
routing::{get, patch, post},
|
||||
BoxError, Router, Server,
|
||||
};
|
||||
|
|
@ -44,6 +47,8 @@ async fn main() {
|
|||
|
||||
// CORS configuration
|
||||
let cors = CorsLayer::new()
|
||||
.allow_credentials(true)
|
||||
.allow_headers([AUTHORIZATION, ACCEPT, CONTENT_TYPE])
|
||||
.allow_methods([Method::GET, Method::POST, Method::PATCH])
|
||||
.allow_origin(
|
||||
if cfg!(debug_assertions) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue