You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-11-21 23:00:50 +03:00
Layer to application/x-www-form-urlencoded bodies
This commit is contained in:
@@ -27,7 +27,7 @@ pub enum Error<Service> {
|
||||
Service { inner: Service },
|
||||
|
||||
#[error("could not parse JSON payload")]
|
||||
Json {
|
||||
Serialize {
|
||||
#[source]
|
||||
inner: serde_json::Error,
|
||||
},
|
||||
@@ -38,8 +38,8 @@ impl<S> Error<S> {
|
||||
Self::Service { inner: source }
|
||||
}
|
||||
|
||||
fn json(source: serde_json::Error) -> Self {
|
||||
Self::Json { inner: source }
|
||||
fn serialize(source: serde_json::Error) -> Self {
|
||||
Self::Serialize { inner: source }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ where
|
||||
let response = res.map_err(Error::service)?;
|
||||
let (parts, body) = response.into_parts();
|
||||
|
||||
let body = serde_json::from_reader(body.reader()).map_err(Error::json)?;
|
||||
let body = serde_json::from_reader(body.reader()).map_err(Error::serialize)?;
|
||||
|
||||
let res = Response::from_parts(parts, body);
|
||||
Ok(res)
|
||||
|
||||
Reference in New Issue
Block a user