Amend,Amend
This commit is contained in:
parent
1e13e8d07e
commit
c6ea22b445
1 changed files with 5 additions and 1 deletions
|
|
@ -28,7 +28,11 @@ pub async fn handle(
|
|||
|
||||
let path_parts: Vec<&str> = path.split("/").collect();
|
||||
let body: Option<JsonValue> = if body_string.is_some() {
|
||||
body_string.map(|s| json::parse(&s).unwrap())
|
||||
if let Ok(body_json) = json::parse(&body_string.unwrap()) {
|
||||
Some(body_json)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue