mirror of
https://github.com/clowzed/sero
synced 2024-06-19 23:05:01 +02:00
Add any for check if cors layer actually works
This commit is contained in:
parent
38dd87bd6e
commit
c819a69741
|
@ -68,6 +68,10 @@ async fn main() {
|
||||||
.route("/", get(handlers::sites::index_redirect))
|
.route("/", get(handlers::sites::index_redirect))
|
||||||
.layer(
|
.layer(
|
||||||
CorsLayer::new()
|
CorsLayer::new()
|
||||||
|
.allow_methods(AllowMethods::any())
|
||||||
|
.allow_headers(AllowHeaders::any())
|
||||||
|
.allow_origin(AllowOrigin::any())
|
||||||
|
/* CorsLayer::new()
|
||||||
.allow_methods(AllowMethods::list([Method::GET, Method::POST, Method::OPTIONS]))
|
.allow_methods(AllowMethods::list([Method::GET, Method::POST, Method::OPTIONS]))
|
||||||
.allow_headers(AllowHeaders::list([HeaderName::from_static("x-subdomain")]))
|
.allow_headers(AllowHeaders::list([HeaderName::from_static("x-subdomain")]))
|
||||||
.allow_origin(AllowOrigin::predicate(move |origin, parts| {
|
.allow_origin(AllowOrigin::predicate(move |origin, parts| {
|
||||||
|
@ -105,7 +109,7 @@ async fn main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
rx.recv().unwrap_or(false)
|
rx.recv().unwrap_or(false)
|
||||||
})),
|
})), */
|
||||||
)
|
)
|
||||||
.with_state(state.clone());
|
.with_state(state.clone());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue