mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-11-09 06:01:05 +01:00
Clean up error handling for server_server::get_server_keys_route
This commit is contained in:
parent
1f7b3fa4ac
commit
d1d2217019
1 changed files with 3 additions and 4 deletions
|
@ -516,10 +516,9 @@ pub async fn get_server_version_route(
|
||||||
/// forever.
|
/// forever.
|
||||||
// Response type for this endpoint is Json because we need to calculate a signature for the response
|
// Response type for this endpoint is Json because we need to calculate a signature for the response
|
||||||
#[tracing::instrument(skip(db))]
|
#[tracing::instrument(skip(db))]
|
||||||
pub async fn get_server_keys_route(db: DatabaseGuard) -> impl IntoResponse {
|
pub async fn get_server_keys_route(db: DatabaseGuard) -> Result<impl IntoResponse> {
|
||||||
if !db.globals.allow_federation() {
|
if !db.globals.allow_federation() {
|
||||||
// TODO: Use proper types
|
return Err(Error::bad_config("Federation is disabled."));
|
||||||
return Json("Federation is disabled.").into_response();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut verify_keys: BTreeMap<Box<ServerSigningKeyId>, VerifyKey> = BTreeMap::new();
|
let mut verify_keys: BTreeMap<Box<ServerSigningKeyId>, VerifyKey> = BTreeMap::new();
|
||||||
|
@ -557,7 +556,7 @@ pub async fn get_server_keys_route(db: DatabaseGuard) -> impl IntoResponse {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
Json(response).into_response()
|
Ok(Json(response))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// # `GET /_matrix/key/v2/server/{keyId}`
|
/// # `GET /_matrix/key/v2/server/{keyId}`
|
||||||
|
|
Loading…
Reference in a new issue