fix optional config section related

split api/client well_known

simplify well_known config access

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-11-24 00:19:55 +00:00
parent 5f1cab6850
commit f30b08f015
9 changed files with 144 additions and 138 deletions

View file

@ -10,7 +10,7 @@ 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.globals.well_known_server() {
server: 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.")),
},