We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5be688e commit 314ec9aCopy full SHA for 314ec9a
1 file changed
src/middleware/cors.rs
@@ -5,8 +5,8 @@
5
/// Router layers for Cross-Origin Resource Sharing (CORS).
6
pub mod layers {
7
use api_framework::static_lazy_lock;
8
- use axum::http::{HeaderValue, request};
9
- use tower_http::cors::{AllowOrigin, CorsLayer};
+ use axum::http::{HeaderValue, header, request};
+ use tower_http::cors::{AllowOrigin, Any, CorsLayer};
10
11
use crate::config::{CorsRuntimeConfig, RuntimeConfig};
12
@@ -16,6 +16,8 @@ pub mod layers {
16
let config = CorsRuntimeConfig::load_or_default().await;
17
config.contains(&origin)
18
}))
19
- .allow_credentials(true);
+ .allow_credentials(true)
20
+ .allow_methods(Any)
21
+ .allow_headers([header::AUTHORIZATION, header::CONTENT_TYPE, header::COOKIE]);
22
}
23
0 commit comments