diff --git a/amnet-server/src/webserver.rs b/amnet-server/src/webserver.rs index 05dd729..fa914a4 100644 --- a/amnet-server/src/webserver.rs +++ b/amnet-server/src/webserver.rs @@ -1,6 +1,6 @@ use std::time::{Duration, Instant}; -use axum::http::{StatusCode, header}; +use axum::http::{Method, StatusCode, header}; use axum::response::{IntoResponse, Response}; use axum::routing::{get, post}; use axum::{Json, Router}; @@ -16,7 +16,7 @@ use crate::webapi::API_VERSION; pub fn build_server() -> Router { let services = ServiceBuilder::new() .layer(TraceLayer::new_for_http()) - .layer(CorsLayer::new().allow_origin(Any).allow_methods(Any)); + .layer(CorsLayer::new().allow_origin(Any).allow_headers(Any).allow_methods([Method::GET, Method::POST]).max_age(Duration::from_secs(600))); Router::<()>::new() .route("/amnet/info", get(server_state_handler))