This commit is contained in:
naskya 2024-07-01 10:52:16 +09:00
parent 97a7db1373
commit 5dd9697fe3
Signed by: naskya
GPG key ID: 712D413B3A9FED5C

View file

@ -340,14 +340,14 @@ fn create_new_server_config(
if let Some(max_size) = default_yml.get("maxFileSize") {
let max_size_mb = max_size
.as_i64()
.ok_or(Error::InvalidConfig("maxFileSize is not an integer"))?
.ok_or(Error::InvalidConfig("`maxFileSize` is not an integer"))?
/ 1_000_000;
file.max_size = Some(max_size_mb as u64);
}
if let Some(proxy_remote_files) = default_yml.get("proxyRemoteFiles") {
let proxy_remote_files = proxy_remote_files
.as_bool()
.ok_or(Error::InvalidConfig("proxyRemoteFiles is not bool"))?;
let proxy_remote_files = proxy_remote_files.as_bool().ok_or(Error::InvalidConfig(
"`proxyRemoteFiles` is not a boolean value",
))?;
file.proxy_remote_file = Some(proxy_remote_files);
}
if meta.cache_remote_files {
@ -368,7 +368,7 @@ fn create_new_server_config(
Some(hosts) => Some(
hosts
.as_vec()
.ok_or(Error::InvalidConfig("proxyBypassHosts is not an array"))?
.ok_or(Error::InvalidConfig("`proxyBypassHosts` is not an array"))?
.iter()
.map(|host| {
host.as_str()
@ -387,7 +387,7 @@ fn create_new_server_config(
enabled: true,
url: url
.as_str()
.ok_or(Error::InvalidConfig("proxyUrl is not a string"))?
.ok_or(Error::InvalidConfig("`proxyUrl` is not a string"))?
.to_string(),
bypass_hosts: http_proxy_bypass_hosts,
}),