mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
refactor: Fix errors in api/server/well_known.rs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Error, Result};
|
||||
use ruma::api::{client::error::ErrorKind, federation::discovery::discover_homeserver};
|
||||
use conduwuit::{Err, Result};
|
||||
use ruma::api::federation::discovery::discover_homeserver;
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
@@ -11,10 +11,10 @@ pub(crate) async fn well_known_server(
|
||||
State(services): State<crate::State>,
|
||||
_body: Ruma<discover_homeserver::Request>,
|
||||
) -> Result<discover_homeserver::Response> {
|
||||
Ok(discover_homeserver::Response {
|
||||
server: match services.server.config.well_known.server.as_ref() {
|
||||
Ok(discover_homeserver::Response::new(
|
||||
match services.server.config.well_known.server.as_ref() {
|
||||
| Some(server_name) => server_name.to_owned(),
|
||||
| None => return Err(Error::BadRequest(ErrorKind::NotFound, "Not found.")),
|
||||
| None => return Err!(Request(NotFound("No well-known server URL is configured."))),
|
||||
},
|
||||
})
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user