Amend es sagt mir Map ist save, map ist nicht save :(
This commit is contained in:
parent
3e119877b1
commit
1e13e8d07e
2 changed files with 5 additions and 2 deletions
|
|
@ -29,7 +29,6 @@ use crate::omikron::omikron_connection::OmikronConnection;
|
||||||
use crate::server::server::start;
|
use crate::server::server::start;
|
||||||
use crate::users::user_manager;
|
use crate::users::user_manager;
|
||||||
use crate::util::config_util::CONFIG;
|
use crate::util::config_util::CONFIG;
|
||||||
use crate::util::file_util::download_and_extract_zip;
|
|
||||||
use crate::util::file_util::has_dir;
|
use crate::util::file_util::has_dir;
|
||||||
|
|
||||||
pub static APP_STATE: LazyLock<Arc<Mutex<AppState>>> =
|
pub static APP_STATE: LazyLock<Arc<Mutex<AppState>>> =
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,11 @@ pub async fn handle(
|
||||||
}
|
}
|
||||||
|
|
||||||
let path_parts: Vec<&str> = path.split("/").collect();
|
let path_parts: Vec<&str> = path.split("/").collect();
|
||||||
let body: Option<JsonValue> = body_string.map(|s| json::parse(&s).unwrap());
|
let body: Option<JsonValue> = if body_string.is_some() {
|
||||||
|
body_string.map(|s| json::parse(&s).unwrap())
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
let (status, content, body_text) = if path_parts.len() >= 3 {
|
let (status, content, body_text) = if path_parts.len() >= 3 {
|
||||||
match path_parts[2] {
|
match path_parts[2] {
|
||||||
"app_state" => (StatusCode::OK, "application/json", {
|
"app_state" => (StatusCode::OK, "application/json", {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue