fix: changed flag name to cross-origin-policy
This commit is contained in:
1 parent
4f95a0ba6b
commit
b196affb02
5 files changed
+26
-48
No files matched your search
Generated
+16
-25
@@ -789,14 +789,14 @@ dependencies = [
|
|||||||
"tower-http 0.2.5",
|
"tower-http 0.2.5",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
"wasm-bindgen-cli-support",
|
"wasm-bindgen-cli-support",
|
||||||
"zip 0.6.4",
|
"zip 0.6.5",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dioxus-core"
|
name = "dioxus-core"
|
||||||
version = "0.3.2"
|
version = "0.3.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bc602f0ca7030f80fe4abc47cc43ffa75c6e7f48208c2b3f6ae24ec7bc6f6618"
|
checksum = "4e4d15b0bb9c58d015b2295f240600dd76e427758377569fa33783afc295706a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bumpalo",
|
"bumpalo",
|
||||||
"bumpslab",
|
"bumpslab",
|
||||||
@@ -1607,15 +1607,6 @@ dependencies = [
|
|||||||
"once_cell",
|
"once_cell",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "iri-string"
|
|
||||||
version = "0.4.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8f0f7638c1e223529f1bfdc48c8b133b9e0b434094d1d28473161ee48b235f78"
|
|
||||||
dependencies = [
|
|
||||||
"nom",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "is_executable"
|
name = "is_executable"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
@@ -1703,9 +1694,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.142"
|
version = "0.2.143"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317"
|
checksum = "edc207893e85c5d6be840e969b496b53d94cec8be2d501b214f50daa97fa8024"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libz-sys"
|
name = "libz-sys"
|
||||||
@@ -2632,9 +2623,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.160"
|
version = "1.0.162"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c"
|
checksum = "71b2f6e1ab5c2b98c05f0f35b236b22e8df7ead6ffbf51d7808da7f8817e7ab6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
@@ -2651,9 +2642,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.160"
|
version = "1.0.162"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df"
|
checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -2919,9 +2910,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time"
|
name = "time"
|
||||||
version = "0.3.20"
|
version = "0.3.21"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890"
|
checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"time-core",
|
"time-core",
|
||||||
@@ -2929,9 +2920,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time-core"
|
name = "time-core"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd"
|
checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tinyvec"
|
name = "tinyvec"
|
||||||
@@ -3870,9 +3861,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zip"
|
name = "zip"
|
||||||
version = "0.6.4"
|
version = "0.6.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0445d0fbc924bb93539b4316c11afb121ea39296f99a3c4c9edad09e3658cdef"
|
checksum = "7e92305c174683d78035cbf1b70e18db6329cc0f1b9cae0a52ca90bf5bfe7125"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes",
|
"aes",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
@@ -3884,7 +3875,7 @@ dependencies = [
|
|||||||
"hmac",
|
"hmac",
|
||||||
"pbkdf2",
|
"pbkdf2",
|
||||||
"sha1",
|
"sha1",
|
||||||
"time 0.3.20",
|
"time 0.3.21",
|
||||||
"zstd",
|
"zstd",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -77,10 +77,11 @@ pub struct ConfigOptsServe {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub hot_reload: bool,
|
pub hot_reload: bool,
|
||||||
|
|
||||||
/// Build with shared_array_buffer enabled in JS [default: false]
|
/// Set cross-origin-policy to same-origin [default: false]
|
||||||
|
#[clap(name="cross-origin-policy")]
|
||||||
#[clap(long)]
|
#[clap(long)]
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub shared_array_buffer: bool,
|
pub cross_origin_policy: bool,
|
||||||
|
|
||||||
/// Space separated list of features to activate
|
/// Space separated list of features to activate
|
||||||
#[clap(long)]
|
#[clap(long)]
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ impl Serve {
|
|||||||
|
|
||||||
// change the relase state.
|
// change the relase state.
|
||||||
crate_config.with_hot_reload(self.serve.hot_reload);
|
crate_config.with_hot_reload(self.serve.hot_reload);
|
||||||
crate_config.with_shared_array_buffer(self.serve.shared_array_buffer);
|
crate_config.with_cross_origin_policy(self.serve.cross_origin_policy);
|
||||||
crate_config.with_release(self.serve.release);
|
crate_config.with_release(self.serve.release);
|
||||||
crate_config.with_verbose(self.serve.verbose);
|
crate_config.with_verbose(self.serve.verbose);
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -146,7 +146,7 @@ pub struct CrateConfig {
|
|||||||
pub dioxus_config: DioxusConfig,
|
pub dioxus_config: DioxusConfig,
|
||||||
pub release: bool,
|
pub release: bool,
|
||||||
pub hot_reload: bool,
|
pub hot_reload: bool,
|
||||||
pub shared_array_buffer: bool,
|
pub cross_origin_policy: bool,
|
||||||
pub verbose: bool,
|
pub verbose: bool,
|
||||||
pub custom_profile: Option<String>,
|
pub custom_profile: Option<String>,
|
||||||
pub features: Option<Vec<String>>,
|
pub features: Option<Vec<String>>,
|
||||||
@@ -214,7 +214,7 @@ impl CrateConfig {
|
|||||||
release,
|
release,
|
||||||
dioxus_config,
|
dioxus_config,
|
||||||
hot_reload,
|
hot_reload,
|
||||||
shared_array_buffer: false,
|
cross_origin_policy: false,
|
||||||
custom_profile,
|
custom_profile,
|
||||||
features,
|
features,
|
||||||
verbose,
|
verbose,
|
||||||
@@ -236,8 +236,8 @@ impl CrateConfig {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_shared_array_buffer(&mut self, shared_array_buffer: bool) -> &mut Self {
|
pub fn with_cross_origin_policy(&mut self, cross_origin_policy: bool) -> &mut Self {
|
||||||
self.shared_array_buffer = shared_array_buffer;
|
self.cross_origin_policy = cross_origin_policy;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-16
@@ -176,13 +176,6 @@ pub async fn startup_hot_reload(ip: String, port: u16, config: CrateConfig, star
|
|||||||
.clone()
|
.clone()
|
||||||
.unwrap_or_else(|| vec![PathBuf::from("src")]);
|
.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_config = config.clone();
|
||||||
let watcher_ip = ip.clone();
|
let watcher_ip = ip.clone();
|
||||||
let mut last_update_time = chrono::Local::now().timestamp();
|
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_origin(Any)
|
||||||
.allow_headers(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("require-corp"),
|
||||||
HeaderValue::from_static("same-origin"),
|
HeaderValue::from_static("same-origin"),
|
||||||
@@ -399,13 +392,6 @@ pub async fn startup_default(
|
|||||||
|
|
||||||
let mut last_update_time = chrono::Local::now().timestamp();
|
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
|
// file watcher: check file change
|
||||||
let allow_watch_path = config
|
let allow_watch_path = config
|
||||||
.dioxus_config
|
.dioxus_config
|
||||||
@@ -476,7 +462,7 @@ pub async fn startup_default(
|
|||||||
.allow_origin(Any)
|
.allow_origin(Any)
|
||||||
.allow_headers(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("require-corp"),
|
||||||
HeaderValue::from_static("same-origin"),
|
HeaderValue::from_static("same-origin"),
|
||||||
|
|||||||
Reference in new issue
Block a user