mirror of
https://github.com/clowzed/sero
synced 2024-06-19 23:05:01 +02:00
Add other methods to cors layer
This commit is contained in:
parent
b0d6cbda17
commit
38dd87bd6e
|
@ -68,7 +68,7 @@ async fn main() {
|
|||
.route("/", get(handlers::sites::index_redirect))
|
||||
.layer(
|
||||
CorsLayer::new()
|
||||
.allow_methods(AllowMethods::exact(Method::GET))
|
||||
.allow_methods(AllowMethods::list([Method::GET, Method::POST, Method::OPTIONS]))
|
||||
.allow_headers(AllowHeaders::list([HeaderName::from_static("x-subdomain")]))
|
||||
.allow_origin(AllowOrigin::predicate(move |origin, parts| {
|
||||
let cloned_state = cloned_state.clone();
|
||||
|
|
Loading…
Reference in a new issue