fix: changed flag name to cross-origin-policy

This commit is contained in:
YuKun Liu committed 2023-05-06 19:37:36 -07:00
1 parent 4f95a0ba6b
commit b196affb02
5 files changed
+26 -48

No files matched your search

+2 -16
View File
@@ -176,13 +176,6 @@ pub async fn startup_hot_reload(ip: String, port: u16, config: CrateConfig, star
.clone()
.unwrap_or_else(|| vec![PathBuf::from("src")]);
let cors = CorsLayer::new()
// allow `GET` and `POST` when accessing the resource
.allow_methods([Method::GET, Method::POST])
// allow requests from any origin
.allow_origin(Any)
.allow_headers(Any);
let watcher_config = config.clone();
let watcher_ip = ip.clone();
let mut last_update_time = chrono::Local::now().timestamp();
@@ -285,7 +278,7 @@ pub async fn startup_hot_reload(ip: String, port: u16, config: CrateConfig, star
.allow_origin(Any)
.allow_headers(Any);
let (coep, coop) = if config.shared_array_buffer {
let (coep, coop) = if config.cross_origin_policy {
(
HeaderValue::from_static("require-corp"),
HeaderValue::from_static("same-origin"),
@@ -399,13 +392,6 @@ pub async fn startup_default(
let mut last_update_time = chrono::Local::now().timestamp();
let cors = CorsLayer::new()
// allow `GET` and `POST` when accessing the resource
.allow_methods([Method::GET, Method::POST])
// allow requests from any origin
.allow_origin(Any)
.allow_headers(Any);
// file watcher: check file change
let allow_watch_path = config
.dioxus_config
@@ -476,7 +462,7 @@ pub async fn startup_default(
.allow_origin(Any)
.allow_headers(Any);
let (coep, coop) = if config.shared_array_buffer {
let (coep, coop) = if config.cross_origin_policy {
(
HeaderValue::from_static("require-corp"),
HeaderValue::from_static("same-origin"),