mirror of https://github.com/LemmyNet/lemmy.git
Adding comment on awc dep.
parent
db52f6b7c7
commit
a6987be62f
|
@ -1885,7 +1885,6 @@ dependencies = [
|
|||
"log",
|
||||
"rss",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"strum",
|
||||
"url",
|
||||
|
|
|
@ -27,7 +27,8 @@ anyhow = "1.0.43"
|
|||
chrono = { version = "0.4.19", features = ["serde"] }
|
||||
rss = "1.10.0"
|
||||
serde = { version = "1.0.127", features = ["derive"] }
|
||||
serde_json = "1.0.66"
|
||||
# TODO awc should use default-features = false, because gzip is a heavy dependency.
|
||||
# This must wait for pictrs to have a configurable disabled gzip
|
||||
awc = "3.0.0-beta.7"
|
||||
url = { version = "2.2.2", features = ["serde"] }
|
||||
strum = "0.21.0"
|
||||
|
|
|
@ -66,9 +66,7 @@ async fn upload(
|
|||
.await
|
||||
.map_err(error::ErrorBadRequest)?;
|
||||
|
||||
// Note: res.json() is currently broken.
|
||||
let body = res.body().await?;
|
||||
let images: Images = serde_json::from_slice(&body)?;
|
||||
let images = res.json::<Images>().await.map_err(error::ErrorBadRequest)?;
|
||||
|
||||
Ok(HttpResponse::build(res.status()).json(images))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue