mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-11 17:31:46 +00:00
formatting cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
acbf549bf0
commit
68f4a68bc1
@ -199,14 +199,11 @@ async fn route_request(request: Request<Body>) -> Result<http::Response<Body>, E
|
|||||||
if let Some(ty) = parts.headers.get(http::header::CONTENT_TYPE) {
|
if let Some(ty) = parts.headers.get(http::header::CONTENT_TYPE) {
|
||||||
if ty.to_str()? == "application/json" {
|
if ty.to_str()? == "application/json" {
|
||||||
use futures::stream::TryStreamExt;
|
use futures::stream::TryStreamExt;
|
||||||
let json = serde_json::from_str(std::str::from_utf8(
|
let json =
|
||||||
body
|
serde_json::from_str(std::str::from_utf8(body.try_concat().await?.as_ref())?)?;
|
||||||
.try_concat()
|
|
||||||
.await?
|
|
||||||
.as_ref()
|
|
||||||
)?)?;
|
|
||||||
match json {
|
match json {
|
||||||
Value::Object(map) => for (k, v) in map {
|
Value::Object(map) => {
|
||||||
|
for (k, v) in map {
|
||||||
let existed = params
|
let existed = params
|
||||||
.get_or_insert_with(serde_json::Map::new)
|
.get_or_insert_with(serde_json::Map::new)
|
||||||
.insert(k, v)
|
.insert(k, v)
|
||||||
@ -215,6 +212,7 @@ async fn route_request(request: Request<Body>) -> Result<http::Response<Body>, E
|
|||||||
bail!("tried to override path-based parameter!");
|
bail!("tried to override path-based parameter!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
_ => bail!("expected a json object"),
|
_ => bail!("expected a json object"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user